Commit d9007455 by Clinton Blackburn

Removed mailing address from provider request

Given the time crunch this is the safest option for dealing with newlines.

ECOM-2492
parent 2653f0ad
......@@ -274,11 +274,7 @@ def create_credit_request(course_key, provider_id, username):
"user_username": user.username,
"user_email": user.email,
"user_full_name": user.profile.name,
"user_mailing_address": (
user.profile.mailing_address
if user.profile.mailing_address is not None
else ""
),
"user_mailing_address": "",
"user_country": (
user.profile.country.code
if user.profile.country.code is not None
......
......@@ -639,7 +639,8 @@ class CreditProviderIntegrationApiTests(CreditApiTestBase):
for key in self.USER_INFO.keys():
param_key = 'user_{key}'.format(key=key)
self.assertIn(param_key, parameters)
self.assertEqual(parameters[param_key], self.USER_INFO[key])
expected = '' if key == 'mailing_address' else self.USER_INFO[key]
self.assertEqual(parameters[param_key], expected)
def test_create_credit_request_grade_length(self):
""" Verify the length of the final grade is limited to seven (7) characters total.
......@@ -656,6 +657,11 @@ class CreditProviderIntegrationApiTests(CreditApiTestBase):
request = api.create_credit_request(self.course_key, self.PROVIDER_ID, self.USER_INFO['username'])
self.assertEqual(request['parameters']['final_grade'], u'0.33333')
def test_create_credit_request_address_empty(self):
""" Verify the mailing address is always empty. """
request = api.create_credit_request(self.course_key, self.PROVIDER_ID, self.user.username)
self.assertEqual(request['parameters']['user_mailing_address'], '')
def test_credit_request_disable_integration(self):
CreditProvider.objects.all().update(enable_integration=False)
......
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