From dbe377ac1fc9f399a778be76c7241c3572c83db6 Mon Sep 17 00:00:00 2001 From: Dennis Siemensma Date: Sat, 28 Jan 2023 15:32:49 +0100 Subject: [PATCH] Fixed test using GitHub API --- dsmr_frontend/tests/webinterface/test_about.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dsmr_frontend/tests/webinterface/test_about.py b/dsmr_frontend/tests/webinterface/test_about.py index a2067448e..0821ffdf2 100644 --- a/dsmr_frontend/tests/webinterface/test_about.py +++ b/dsmr_frontend/tests/webinterface/test_about.py @@ -1,3 +1,5 @@ +from unittest import mock + from django.test import TestCase, Client from django.urls import reverse @@ -6,7 +8,7 @@ class TestAbout(TestCase): def setUp(self): self.client = Client() - def test_unauthenticated(self): + def test_okay(self): response = self.client.get(reverse("frontend:about")) self.assertEqual(response.status_code, 200, response.content) self.assertIn("monitoring_issues", response.context) @@ -16,6 +18,9 @@ class TestAboutXhrUpdateCheck(TestCase): def setUp(self): self.client = Client() - def test_unauthenticated(self): + @mock.patch("dsmr_backend.services.backend.is_latest_version") + def test_okay(self, is_latest_version_mock): + is_latest_version_mock.return_value = True + response = self.client.get(reverse("frontend:about-xhr-update-check")) self.assertEqual(response.status_code, 200, response.content)