Commit 27eea34a by Jeff LaJoie

test updates

parent d27e9086
...@@ -27,6 +27,7 @@ class CourseFactory(factory.DjangoModelFactory): ...@@ -27,6 +27,7 @@ class CourseFactory(factory.DjangoModelFactory):
learner_testimonial = FuzzyText() learner_testimonial = FuzzyText()
level_type = factory.SubFactory(factories.LevelTypeFactory) level_type = factory.SubFactory(factories.LevelTypeFactory)
image = factory.django.ImageField() image = factory.django.ImageField()
version = FuzzyInteger(0, 1)
primary_subject = factory.SubFactory(factories.SubjectFactory) primary_subject = factory.SubFactory(factories.SubjectFactory)
secondary_subject = factory.SubFactory(factories.SubjectFactory) secondary_subject = factory.SubFactory(factories.SubjectFactory)
......
...@@ -758,6 +758,28 @@ class CourseRunDetailTests(SiteMixin, TestCase): ...@@ -758,6 +758,28 @@ class CourseRunDetailTests(SiteMixin, TestCase):
self.course_run.enrollment_end]: self.course_run.enrollment_end]:
self.assertContains(response, value.strftime(self.date_format)) self.assertContains(response, value.strftime(self.date_format))
def test_course_run_with_version(self):
"""
Verify that a SEAT_VERSION course still shows enrollment
track data, and an ENTITLEMENT_VERSION course does not
"""
self.client.logout()
self.client.login(username=self.user.username, password=USER_PASSWORD)
# For SEAT_VERSION Enrollment Track should be shown
self.course.version = Course.SEAT_VERSION
self.course.save()
response = self.client.get(self.page_url)
self.assertEqual(response.status_code, 200)
self.assertContains(response, 'Enrollment Track')
# For ENTITLEMENT_VERSION no Enrollment Track should be show
self.course.version = Course.ENTITLEMENT_VERSION
self.course.save()
response = self.client.get(self.page_url)
self.assertEqual(response.status_code, 200)
self.assertContains(response, 'Enrollment Track')
def test_detail_page_with_comments(self): def test_detail_page_with_comments(self):
""" Verify that detail page contains all the data along with comments """ Verify that detail page contains all the data along with comments
for course. for course.
......
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