Beispiel #1
0
    def test_generate_question_plan_finished(self):
        """
    Месячный план ВЫПОЛНЕН
    """
        employee = Employee.get(1)
        PlanCtrl.create(employee.n, today.year, today.month, 1, 1)

        question = QuestionCtrl.generate_question(employee.name)
        assert question.n == 0  # question.n=0 пустой вопрос, означает нет вопроса
Beispiel #2
0
    def test_generate_question_day_finish(self):
        """
    План НЕ ВЫПОЛНЕН. Дневной план ВЫПОЛНЕН
    """
        employee = Employee.get(1)
        PlanCtrl.create(employee.n, today.year, today.month, 2, 1)

        question = QuestionCtrl.generate_question(employee.name)
        # print(question)
        assert question.n == 0  # question.n=0 пустой вопрос, означает нет вопроса
Beispiel #3
0
    def test_generate_question_day_not_finish(self):
        """
    План НЕ ВЫПОЛНЕН. Дневной план НЕ ВЫПОЛНЕН
    """
        employee = Employee.get(1)
        PlanCtrl.create(employee.n, today.year, today.month, 2, 3)

        question = QuestionCtrl.generate_question(employee.name)
        # print(question)
        assert question.n != 0  # question.n=0 пустой вопрос, означает нет вопроса
        ANSWERED_QUESTION_N = 21  # номер отвеченного вопроса из фикстуры
        assert question.n != ANSWERED_QUESTION_N
Beispiel #4
0
 def test_repeat_question(self):
     employee = Employee.get(1)
     question = QuestionCtrl.get_repeat(employee)
     assert question.n == 31
Beispiel #5
0
 def test_already_answered(self):
     today = date.today()
     employee = Employee.get(1)
     qty_answered = ResultCtrl.count_answered(employee, today.year,
                                              today.month)
     assert qty_answered == 2