Refactor student login for readability and fix Django 1.11 issues

This commit is contained in:
bmedx
2018-01-16 15:21:00 -05:00
parent 46cb89e55d
commit 1d45c85135
25 changed files with 3567 additions and 3302 deletions

View File

@@ -322,7 +322,7 @@ class ShibSPTest(CacheIsolationTestCase):
'terms_of_service': u'true',
'honor_code': u'true'}
with patch('student.views.AUDIT_LOG') as mock_audit_log:
with patch('student.views.management.AUDIT_LOG') as mock_audit_log:
self.client.post('/create_account', data=postvars)
mail = identity.get('mail')

View File

@@ -200,7 +200,7 @@ class TestAccountApi(UserSettingsEventTestMixin, TestCase):
self.assertIn("Full Name cannot contain the following characters: < >", field_errors["name"]["user_message"])
@patch('django.core.mail.send_mail')
@patch('student.views.render_to_string', Mock(side_effect=mock_render_to_string, autospec=True))
@patch('student.views.management.render_to_string', Mock(side_effect=mock_render_to_string, autospec=True))
def test_update_sending_email_fails(self, send_mail):
"""Test what happens if all validation checks pass, but sending the email for email change fails."""
send_mail.side_effect = [Exception, None]