Exemple #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 пустой вопрос, означает нет вопроса
Exemple #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 пустой вопрос, означает нет вопроса
Exemple #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
 def test_create(self):
     plan = PlanCtrl.create(1, 2000, 2, 10, 20)
     self.assertEqual(plan.n, 2)
     self.assertEqual(plan.employee_n, 1)
     self.assertEqual(plan.year, 2000)
     self.assertEqual(plan.month, 2)
     self.assertEqual(plan.qty_work, 10)
     self.assertEqual(plan.qty_question, 20)
 def test_create_for_params(self):
     params = {
         'employee_n': 1,
         'year': 2000,
         'month': 2,
         'qty_work': 10,
         'qty_question': 20
     }
     plan = PlanCtrl.create(**params)
     self.assertEqual(plan.n, 2)
     self.assertEqual(plan.employee_n, 1)
     self.assertEqual(plan.year, 2000)
     self.assertEqual(plan.month, 2)
     self.assertEqual(plan.qty_work, 10)
     self.assertEqual(plan.qty_question, 20)