From 6659d1a4a0fa13e5d5c4b17e76a40234cff1a28f Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Mon, 23 Nov 2020 14:38:47 +0100 Subject: [PATCH] first client test --- input/tests.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/input/tests.py b/input/tests.py index ff6dd91..a5e94e9 100644 --- a/input/tests.py +++ b/input/tests.py @@ -1,14 +1,22 @@ from django.test import TestCase +from django.conf import settings from .models import HonoraryCertificate # Create your tests here. class TestGranted(TestCase): + def setUp(self): + #this supress an unwanted warning about missing root dir + settings.WHITENOISE_AUTOREFRESH = True + def test_set_granted(self): obj = HonoraryCertificate.objects.create(realname='hurzel',email='hurzel@web.de') self.assertEqual(obj.granted,None) - print(obj.pk) HonoraryCertificate.set_granted(obj.pk, True) obj2 = HonoraryCertificate.objects.get(pk=obj.pk) self.assertEqual(obj2.granted,True) + + def test_source_link(self): + response = self.client.get('') + self.assertContains(response,'Sourcecode')