some documentation

This commit is contained in:
Benni Bärmann 2020-11-23 17:16:03 +01:00
parent adc34e6d2d
commit bcefb026d1
2 changed files with 13 additions and 1 deletions

View File

@ -6,6 +6,9 @@ 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
@ -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

View File

@ -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,'<a href="https://srcsrv.wikimedia.de/beba/foerderbarometer">Sourcecode</a>')
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')