Example #1
0
    def test_comment_delete_view_response(self):
        setup_account(self)
        task_object: TaskCreateModel = TaskObject.create_task_object()

        response = self.client.get(
            reverse("comment_delete", args=[task_object.id]))
        self.assertEqual(response.status_code, 200)
Example #2
0
    def test_task_title(self):
        setup_account(self)
        task_object: TaskCreateModel = TaskObject.create_task_object()

        response = self.client.get("/tasks/")
        """test the actual response back"""
        self.assertIn(str.encode(task_object.task_title), response.content)
Example #3
0
    def test_model_fields(self):
        setup_account(self)
        self.assertEqual(str(self.task_object.task_title),
                         self.task_object.task_title)

        self.assertEqual(str(self.task_object.task_description),
                         self.task_object.task_description)
        self.assertEqual(str(self.task_object.comment_on_task),
                         self.task_object.comment_on_task)
Example #4
0
 def test_home_view_returns_correct_html(self):
     setup_account(self)
     request = HttpRequest()
     request.user = self.user
     response = home_view(request)
     html = response.content.decode("utf8")
     self.assertTrue(html.startswith("<html>"))
     self.assertIn("<title>Task Management System</title>", html)
     self.assertTrue(html.endswith("</html>"))
Example #5
0
 def test_login_view_response(self):
     setup_account(self)
     response = self.client.get("")
     self.assertEqual(response.status_code, 200)
Example #6
0
 def test_logout_view_response(self):
     setup_account(self)
     response = self.client.get("/accounts/logout/", follow=True)
     self.assertEqual(response.status_code, 200)
Example #7
0
 def test_create_account_view_response(self):
     setup_account(self)
     response = self.client.get("/accounts/register/")
     self.assertEqual(response.status_code, 200)
Example #8
0
 def test_all_tasks_view_response(self):
     setup_account(self)
     response = self.client.get("/tasks/")
     self.assertEqual(response.status_code, 200)