Permalink
Browse files

Remove assertRedirects for reals this time

  • Loading branch information...
1 parent 4acdee1 commit 1a32ce7864071eea01be1153b69c2fdfcb0706a4 @kumar303 kumar303 committed Dec 13, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 webpay/pin/tests/test_views.py
@@ -31,7 +31,7 @@ def test_buyer_does_not_exist(self, change_pin, create_buyer):
res = self.client.post(self.url, data={'pin': '1234'})
assert create_buyer.called
assert not change_pin.called
- self.assertRedirects(res, reverse('pin.confirm'))
+ assert res['Location'].endswith(reverse('pin.confirm'))
@patch('lib.solitude.api.client.create_buyer', auto_spec=True)
@patch('lib.solitude.api.client.change_pin', auto_spec=True)
@@ -40,7 +40,7 @@ def test_buyer_does_exist_with_no_pin(self, change_pin, create_buyer):
res = self.client.post(self.url, data={'pin': '1234'})
assert not create_buyer.called
assert change_pin.called
- self.assertRedirects(res, reverse('pin.confirm'))
+ assert res['Location'].endswith(reverse('pin.confirm'))
@patch('lib.solitude.api.client.create_buyer', auto_spec=True)
@patch('lib.solitude.api.client.change_pin', auto_spec=True)
@@ -112,7 +112,7 @@ def test_unauth(self):
@patch.object(client, 'confirm_pin', lambda x, y: True)
def test_good_pin(self):
res = self.client.post(self.url, data={'pin': '1234'})
- self.assertRedirects(res, get_payment_url())
+ assert res['Location'].endswith(get_payment_url())
@patch.object(client, 'confirm_pin', lambda x, y: False)
def test_bad_pin(self):

0 comments on commit 1a32ce7

Please sign in to comment.