diff --git a/common/djangoapps/student/tests/test_login_registration_forms.py b/common/djangoapps/student/tests/test_login_registration_forms.py index 346ed4cdd9..a1feff45d9 100644 --- a/common/djangoapps/student/tests/test_login_registration_forms.py +++ b/common/djangoapps/student/tests/test_login_registration_forms.py @@ -1,6 +1,7 @@ """Tests for the login and registration form rendering. """ import urllib import unittest +from collections import OrderedDict from mock import patch from django.conf import settings from django.core.urlresolvers import reverse @@ -125,6 +126,29 @@ class LoginFormTest(ModuleStoreTestCase): ) self.assertContains(response, expected_url) + @ddt.data(None, "true", "false") + def test_email_opt_in(self, opt_in_value): + params = { + 'course_id': self.course_id, + 'enrollment_action': 'enroll' + } + + if opt_in_value is not None: + params['email_opt_in'] = opt_in_value + + # Get the login page + response = self.client.get(self.url, params) + + # Verify that the hidden parameter is set correctly + hidden_param = ' % endif +% if email_opt_in: + +% endif +