test: test function to check if site is up
This commit is contained in:
parent
0ccbb18411
commit
ab3437e61d
@ -2,6 +2,7 @@ from datetime import timedelta
|
|||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from fellchensammlung.tools.admin import get_unchecked_adoption_notices, deactivate_unchecked_adoption_notices
|
from fellchensammlung.tools.admin import get_unchecked_adoption_notices, deactivate_unchecked_adoption_notices
|
||||||
|
from fellchensammlung.tools.misc import is_404
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
from model_bakery import baker
|
from model_bakery import baker
|
||||||
@ -48,4 +49,12 @@ class DeactiviationTest(TestCase):
|
|||||||
|
|
||||||
self.assertFalse(self.adoption1.is_active)
|
self.assertFalse(self.adoption1.is_active)
|
||||||
self.assertFalse(self.adoption2.is_active)
|
self.assertFalse(self.adoption2.is_active)
|
||||||
self.assertTrue(self.adoption3.is_active)
|
self.assertTrue(self.adoption3.is_active)
|
||||||
|
|
||||||
|
|
||||||
|
class PingTest(TestCase):
|
||||||
|
def test_is_404(self):
|
||||||
|
urls = [("https://hyteck.de/maxwell", True),
|
||||||
|
("https://hyteck.de", False)]
|
||||||
|
for url, expected_result in urls:
|
||||||
|
self.assertEqual(is_404(url), expected_result)
|
||||||
|
Loading…
Reference in New Issue
Block a user