Ejemplo n.º 1
0
    def test_yesterday_semester(self):
        """
        Tests that out utility function returns yesterday's semester
        """

        current_semester = SemesterFactory.create(end=datetime.now().date() - timedelta(days=1))

        self.assertEquals(current_semester, get_yesterday_semester())
Ejemplo n.º 2
0
    def test_yesterday_semester(self):
        """
        Tests that out utility function returns yesterday's semester
        """

        current_semester = SemesterFactory.create(end=datetime.now().date() -
                                                  timedelta(days=1))

        self.assertEquals(current_semester, get_yesterday_semester())
Ejemplo n.º 3
0
    def test_disable_faculty(self):
        """
        Tests if our tasks will disable inactive faculty
        """

        faculty = FacultyFactory.create()
        current_semester = SemesterFactory.create(end=datetime.now().date() - timedelta(days=1))
        next_semester = SemesterFactory.create(
            start=datetime.now().date() + timedelta(days=60), end=datetime.now().date() + timedelta(days=90)
        )

        current_course = CourseFactory.create(semester=current_semester)
        next_course = CourseFactory.create(semester=next_semester)

        current_course.faculty.add(faculty)

        disable_faculty()

        faculty = User.objects.get(username=faculty.username)
        self.assertEquals(faculty.is_active, False)
Ejemplo n.º 4
0
    def test_disable_faculty(self):
        """
        Tests if our tasks will disable inactive faculty
        """

        faculty = FacultyFactory.create()
        current_semester = SemesterFactory.create(end=datetime.now().date() -
                                                  timedelta(days=1))
        next_semester = SemesterFactory.create(
            start=datetime.now().date() + timedelta(days=60),
            end=datetime.now().date() + timedelta(days=90))

        current_course = CourseFactory.create(semester=current_semester)
        next_course = CourseFactory.create(semester=next_semester)

        current_course.faculty.add(faculty)

        disable_faculty()

        faculty = User.objects.get(username=faculty.username)
        self.assertEquals(faculty.is_active, False)