From 71b333e3d761fe31f6124e0cfbebe470ed8c2704 Mon Sep 17 00:00:00 2001 From: Andy McKay Date: Wed, 27 Jun 2012 15:03:18 -0700 Subject: [PATCH] fix tests and remove silly one --- mkt/account/tests/test_views.py | 19 ++++++------------- settings_test.py | 1 + 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/mkt/account/tests/test_views.py b/mkt/account/tests/test_views.py index cb420c1d99..6db18b4b70 100644 --- a/mkt/account/tests/test_views.py +++ b/mkt/account/tests/test_views.py @@ -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') diff --git a/settings_test.py b/settings_test.py index 8247ae7a4f..4b7571df6e 100644 --- a/settings_test.py +++ b/settings_test.py @@ -92,3 +92,4 @@ DEBUG_TOOLBAR_CONFIG = { } MOZMARKET_VENDOR_EXCLUDE = [] +SECLUSION_HOSTS = ('http://localhost/',)