Commit a1a9a2a5 by David Ormsbee

Convert UpdateEmailOptInTestCase to use SharedModuleStoreTestCase

parent fdfaa565
...@@ -31,7 +31,7 @@ from third_party_auth.tests.utils import ( ...@@ -31,7 +31,7 @@ from third_party_auth.tests.utils import (
ThirdPartyOAuthTestMixin, ThirdPartyOAuthTestMixinFacebook, ThirdPartyOAuthTestMixinGoogle ThirdPartyOAuthTestMixin, ThirdPartyOAuthTestMixinFacebook, ThirdPartyOAuthTestMixinGoogle
) )
from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from ..accounts.api import get_account_settings from ..accounts.api import get_account_settings
from ..accounts import ( from ..accounts import (
NAME_MAX_LENGTH, EMAIL_MIN_LENGTH, EMAIL_MAX_LENGTH, PASSWORD_MIN_LENGTH, PASSWORD_MAX_LENGTH, NAME_MAX_LENGTH, EMAIL_MIN_LENGTH, EMAIL_MAX_LENGTH, PASSWORD_MIN_LENGTH, PASSWORD_MAX_LENGTH,
...@@ -1714,20 +1714,24 @@ class TestGoogleRegistrationView( ...@@ -1714,20 +1714,24 @@ class TestGoogleRegistrationView(
@ddt.ddt @ddt.ddt
class UpdateEmailOptInTestCase(ApiTestCase, ModuleStoreTestCase): class UpdateEmailOptInTestCase(ApiTestCase, SharedModuleStoreTestCase):
"""Tests the UpdateEmailOptInPreference view. """ """Tests the UpdateEmailOptInPreference view. """
USERNAME = "steve" USERNAME = "steve"
EMAIL = "steve@isawesome.com" EMAIL = "steve@isawesome.com"
PASSWORD = "steveopolis" PASSWORD = "steveopolis"
@classmethod
def setUpClass(cls):
super(UpdateEmailOptInTestCase, cls).setUpClass()
cls.course = CourseFactory.create()
cls.url = reverse("preferences_email_opt_in")
def setUp(self): def setUp(self):
""" Create a course and user, then log in. """ """ Create a course and user, then log in. """
super(UpdateEmailOptInTestCase, self).setUp() super(UpdateEmailOptInTestCase, self).setUp()
self.course = CourseFactory.create()
self.user = UserFactory.create(username=self.USERNAME, email=self.EMAIL, password=self.PASSWORD) self.user = UserFactory.create(username=self.USERNAME, email=self.EMAIL, password=self.PASSWORD)
self.client.login(username=self.USERNAME, password=self.PASSWORD) self.client.login(username=self.USERNAME, password=self.PASSWORD)
self.url = reverse("preferences_email_opt_in")
@ddt.data( @ddt.data(
(u"True", u"True"), (u"True", u"True"),
......
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