You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
829 B
28 lines
829 B
from django.test import TestCase
|
|
from django_faker import Faker
|
|
from django.core.urlresolvers import reverse
|
|
|
|
from apps.course.models import Course
|
|
from project.tests.factories import *
|
|
|
|
|
|
class CoursesTestCase(TestCase):
|
|
|
|
@classmethod
|
|
def setUpTestData(cls):
|
|
for i in range(10):
|
|
CourseFactory()
|
|
|
|
def test_courses_url_accessible(self):
|
|
resp = self.client.get(reverse('courses'))
|
|
self.assertEqual(resp.status_code, 200)
|
|
|
|
def test_course_url_accessible(self):
|
|
course = Course.objects.all()[:1][0]
|
|
resp = self.client.get(course.url)
|
|
self.assertEqual(resp.status_code, 200)
|
|
|
|
def test_course_edit_url_accessible(self):
|
|
course = Course.objects.all()[:1][0]
|
|
resp = self.client.get(course.url)
|
|
self.assertEqual(resp.status_code, 200)
|
|
|