Commit acc9bca3 by Calen Pennington

Merge pull request #12626 from cpennington/reset-parameters-fake-payment-tests

Reset client post parameters after each payment_fake test, because th…
parents 95054e1a 234ed763
......@@ -15,7 +15,13 @@ class PaymentFakeViewTest(TestCase):
correctly with the shopping cart.
"""
CLIENT_POST_PARAMS = OrderedDict([
def setUp(self):
super(PaymentFakeViewTest, self).setUp()
# Reset the view state
PaymentFakeView.PAYMENT_STATUS_RESPONSE = "success"
self.client_post_params = OrderedDict([
('amount', '25.00'),
('currency', 'usd'),
('transaction_type', 'sale'),
......@@ -31,16 +37,10 @@ class PaymentFakeViewTest(TestCase):
('signed_date_time', '2014-08-18T13:59:31Z'),
])
def setUp(self):
super(PaymentFakeViewTest, self).setUp()
# Reset the view state
PaymentFakeView.PAYMENT_STATUS_RESPONSE = "success"
def test_accepts_client_signatures(self):
# Generate shoppingcart signatures
post_params = sign(self.CLIENT_POST_PARAMS)
post_params = sign(self.client_post_params)
# Simulate a POST request from the payment workflow
# page to the fake payment page.
......@@ -58,7 +58,7 @@ class PaymentFakeViewTest(TestCase):
def test_rejects_invalid_signature(self):
# Generate shoppingcart signatures
post_params = sign(self.CLIENT_POST_PARAMS)
post_params = sign(self.client_post_params)
# Tamper with the signature
post_params['signature'] = "invalid"
......@@ -75,7 +75,7 @@ class PaymentFakeViewTest(TestCase):
def test_sends_valid_signature(self):
# Generate shoppingcart signatures
post_params = sign(self.CLIENT_POST_PARAMS)
post_params = sign(self.client_post_params)
# Get the POST params that the view would send back to us
resp_params = PaymentFakeView.response_post_params(post_params)
......@@ -90,7 +90,7 @@ class PaymentFakeViewTest(TestCase):
def test_set_payment_status(self):
# Generate shoppingcart signatures
post_params = sign(self.CLIENT_POST_PARAMS)
post_params = sign(self.client_post_params)
# Configure the view to declined payments
resp = self.client.put(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment