use login_ajax for logistration

- use login_ajax (in place of login_session with shim) for
logistration's call to login POST
- add toggle for using login_ajax from logistration
  - FEATURES['ENABLE_LOGIN_POST_WITHOUT_SHIM']
- add custom metrics for redirect_url
- update test for third-party auth error_code

NOTE: The error_code `third-party-auth-with-no-linked-account`
was introduced in JSON in this earlier PR:
https://github.com/edx/edx-platform/pull/22452/files

ARCH-1253
This commit is contained in:
Robert Raposa
2019-12-06 15:34:50 -05:00
parent 7eb21f4dec
commit d79e7df32b
5 changed files with 96 additions and 13 deletions

View File

@@ -130,11 +130,10 @@ class HelperMixin(object):
def assert_json_failure_response_is_missing_social_auth(self, response):
"""Asserts failure on /login for missing social auth looks right."""
self.assertContains(
response,
u"successfully signed in to your %s account, but this account isn't linked" % self.provider.name,
status_code=403,
)
self.assertEqual(403, response.status_code)
payload = json.loads(response.content.decode('utf-8'))
self.assertFalse(payload.get('success'))
self.assertEqual(payload.get('error_code'), 'third-party-auth-with-no-linked-account')
def assert_json_failure_response_is_username_collision(self, response):
"""Asserts the json response indicates a username collision."""