From bcefb026d175e29b5ed83f1f758f4ed9818cfedf Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Mon, 23 Nov 2020 17:16:03 +0100 Subject: [PATCH] some documentation --- README.md | 11 ++++++++++- input/tests.py | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c976a7..0e9a9b3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,10 @@ purpose: gather data from intern(WMDE) and extern(volunteers) forms to create a ln -sr foerderbarometer/settings_development.py foerderbarometer/settings.py - +build database with + + python3 manage.py makemigrations + run the development server with python3 manage.py runserver @@ -19,6 +22,12 @@ run the development server with whitenoise 5.2.0 gunicorn 20.0.4 +## testing + +run some tests with + + python3 manage.py test + ## production setup ln -sr foerderbarometer/settings_production.py foerderbarometer/settings.py diff --git a/input/tests.py b/input/tests.py index a004e4f..8b6de2e 100644 --- a/input/tests.py +++ b/input/tests.py @@ -11,6 +11,7 @@ class TestGranted(TestCase): settings.WHITENOISE_AUTOREFRESH = True def test_set_granted(self): + '''test if the model function set_granted() works as intended''' obj = HonoraryCertificate.objects.create(realname='hurzel',email='hurzel@web.de') self.assertEqual(obj.granted,None) HonoraryCertificate.set_granted(obj.pk, True) @@ -18,10 +19,12 @@ class TestGranted(TestCase): self.assertEqual(obj2.granted,True) def test_source_link(self): + '''test if link to source code is included in main page''' response = self.client.get('', follow=True) #print (response.content) self.assertContains(response,'Sourcecode') def test_access_denied(self): + '''test if /intern redirects to login page if not logged in''' response = self.client.get('/intern', follow=True) self.assertContains(response,'password')