Browse Source

some documentation

master
Benni Bärmann 2 years ago
parent
commit
bcefb026d1
  1. 11
      README.md
  2. 3
      input/tests.py

11
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

3
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,'<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')
Loading…
Cancel
Save