Beispiel #1
0
def test_invalid_course_creation(invalid_courses):
    course = Course(*invalid_courses)
    course.save()

    assert Course.objects.filter(pk=course.course_id).count() == 0
Beispiel #2
0
def test_course_save_course(valid_courses):
    course = Course(*valid_courses)
    course.save()
    # check that it's the same object
    db_course = Course.objects.get(pk=course.course_id)
    assert db_course == course
 def courses(self):
     course0 = Course(course_id=100231, name='course0', mandatory=True, credit_points=1)
     course0.save()
     course1 = Course(course_id=100400, name='course1', mandatory=True, credit_points=1)
     course1.save()
     return (course0, course1)