Commit 276ea2fe by Carlos Andrés Rocha

Fix tests not using ModuleStoreTestCase

Some tests test were using `CourseFactory` buy not deriving from
`ModuleStoreTestCase`, introducing a course leaks that broke other
unrelated tests.
parent 2d05ffac
...@@ -5,12 +5,13 @@ Tests for the certificates models. ...@@ -5,12 +5,13 @@ Tests for the certificates models.
from django.test import TestCase from django.test import TestCase
from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from student.tests.factories import UserFactory from student.tests.factories import UserFactory
from certificates.models import CertificateStatuses, GeneratedCertificate, certificate_status_for_student from certificates.models import CertificateStatuses, GeneratedCertificate, certificate_status_for_student
class CertificatesModelTest(TestCase): class CertificatesModelTest(ModuleStoreTestCase):
""" """
Tests for the GeneratedCertificate model Tests for the GeneratedCertificate model
""" """
......
...@@ -15,6 +15,7 @@ from instructor_analytics.basic import ( ...@@ -15,6 +15,7 @@ from instructor_analytics.basic import (
) )
from courseware.tests.factories import InstructorFactory from courseware.tests.factories import InstructorFactory
from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
class TestAnalyticsBasic(TestCase): class TestAnalyticsBasic(TestCase):
...@@ -52,7 +53,7 @@ class TestAnalyticsBasic(TestCase): ...@@ -52,7 +53,7 @@ class TestAnalyticsBasic(TestCase):
self.assertEqual(set(AVAILABLE_FEATURES), set(STUDENT_FEATURES + PROFILE_FEATURES)) self.assertEqual(set(AVAILABLE_FEATURES), set(STUDENT_FEATURES + PROFILE_FEATURES))
class TestCourseSaleRecordsAnalyticsBasic(TestCase): class TestCourseSaleRecordsAnalyticsBasic(ModuleStoreTestCase):
""" Test basic course sale records analytics functions. """ """ Test basic course sale records analytics functions. """
def setUp(self): def setUp(self):
""" """
...@@ -100,7 +101,7 @@ class TestCourseSaleRecordsAnalyticsBasic(TestCase): ...@@ -100,7 +101,7 @@ class TestCourseSaleRecordsAnalyticsBasic(TestCase):
self.assertEqual(sale_record['total_codes'], 5) self.assertEqual(sale_record['total_codes'], 5)
class TestCourseRegistrationCodeAnalyticsBasic(TestCase): class TestCourseRegistrationCodeAnalyticsBasic(ModuleStoreTestCase):
""" Test basic course registration codes analytics functions. """ """ Test basic course registration codes analytics functions. """
def setUp(self): def setUp(self):
""" """
......
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