fix tests and remove silly one

This commit is contained in:
Andy McKay 2012-06-27 15:03:18 -07:00
Родитель 8d2629fd3e
Коммит 71b333e3d7
2 изменённых файлов: 7 добавлений и 13 удалений

Просмотреть файл

@ -322,25 +322,18 @@ class TestPreapproval(amo.tests.TestCase):
eq_(doc('#preapproval').attr('action'),
reverse('account.payment.preapproval'))
@mock.patch('mkt.account.views.client.post_preapproval')
@mock.patch('mkt.account.views.client')
@mock.patch('mkt.account.views.waffle.flag_is_active')
def test_preapproval_solitude(self, flag_is_active, post_preapproval):
def test_preapproval_solitude(self, flag_is_active, client):
flag_is_active.return_value = True
url = 'http://foo.com/?bar'
post_preapproval.return_value = {'paypal_url': url, 'key': 'bar'}
client.post_preapproval.return_value = {'paypal_url': url,
'key': 'bar'}
res = self.client.post(reverse('account.payment.preapproval'),
{'currency': 'USD'})
eq_(res['Location'], url)
eq_(self.user.pk, post_preapproval.call_args[1]['data']['uuid'].pk)
@mock.patch('mkt.account.views.client.post_preapproval')
@mock.patch('mkt.account.views.waffle.flag_is_active')
def test_preapproval_solitude_err(self, flag_is_active, post_preapproval):
flag_is_active.return_value = True
post_preapproval.side_effect = client.Error
self.assertRaises(client.Error, self.client.post,
reverse('account.payment.preapproval'),
{'currency': 'USD'})
eq_(self.user.pk,
client.post_preapproval.call_args[1]['data']['uuid'].pk)
@mock.patch('paypal.get_preapproval_key')
@mock.patch('mkt.account.views.waffle.switch_is_active')

Просмотреть файл

@ -92,3 +92,4 @@ DEBUG_TOOLBAR_CONFIG = {
}
MOZMARKET_VENDOR_EXCLUDE = []
SECLUSION_HOSTS = ('http://localhost/',)