def test_multiple_tasks(self):
        create_deadline()
        set_task_status()
        logic.create_tasks()

        self.assert_date_of_test_task()
        self.assert_date_of_test_deadline_task()
    def test_create_tasks(self):
        # setup
        set_task_status()
        logic.create_tasks()

        # analyze
        self.assert_date_of_test_task()
示例#3
0
def completed_tasks(request):
    """ see all copleted tasks in a list """
    logic.create_tasks()
    tasks_by_dates = logic.get_completed_tasks_by_dates()
    return render(request, 'paperwork/tasks.html', {
        "tasks_by_dates": tasks_by_dates,
        "other_link": reverse('paperwork:tasks')
    })
    def test_submit_of_signature_moves_date(self):
        """
        When the final task is marked as completed, it should reset all the
        corresponding tasks and change the date of the review task.
        """
        # setup
        set_task_status()
        logic.create_tasks()

        # "checkbox" for the task with a review.
        test_task = get_test_task()
        logic.update_completed_tasks({"completed": str(test_task.id)})

        # assert afterwards
        test_task = get_review_test_task()  # grab the object again
        target_date = datetime.date.today() + datetime.timedelta(days=90)
        self.assertEqual(target_date, test_task.date)
    def test_create_tasks_for_multiple_clients(self):
        # setup
        create_multiple_clients()

        # set task statuses
        set_task_status()
        client = get_test_client()
        deliverable = get_test_deliverable()
        other_client = get_other_test_client()
        logic.update_task_statuses({
            get_id_string(client.id, deliverable.id):
            "on",
            get_id_string(other_client.id, deliverable.id):
            "on",
        })

        logic.create_tasks()

        self.assert_date_of_test_task()
        self.assert_date_of_other_client_test_task()
    def test_tasks_from_multiple_deliverables(self):
        # create multiple deliverables
        create_multiple_deliverables()

        # set task statuses
        set_task_status()
        client = get_test_client()
        deliverable = get_test_deliverable()
        other_deliverable = get_other_test_deliverable()
        logic.update_task_statuses({
            get_id_string(client.id, deliverable.id):
            "on",
            get_id_string(client.id, other_deliverable.id):
            "on",
        })

        # make tasks
        logic.create_tasks()
        self.assert_date_of_test_task()
        self.assert_date_of_other_test_task()
示例#7
0
def make_tasks(_):
    logic.create_tasks()
    return HttpResponseRedirect(reverse('paperwork:tasks'))