basic login test, fixture deleted (no longer needed)
This commit is contained in:
parent
2c0b4a1988
commit
3132bc9647
3 changed files with 15 additions and 4 deletions
File diff suppressed because one or more lines are too long
|
@ -56,7 +56,7 @@ Du hast {{choice}} ausgewählt.
|
|||
</form>
|
||||
<p>
|
||||
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c4/Figuren_klein.jpg"><p>
|
||||
Eine Übersicht alle Förderangebote von Wikimedia Deutschland findest du im <a href="https://de.wikipedia.org/wiki/Wikipedia:Förderung/Förderangebote">
|
||||
Eine Übersicht aller Förderangebote von Wikimedia Deutschland findest du im <a href="https://de.wikipedia.org/wiki/Wikipedia:Förderung/Förderangebote">
|
||||
Förderportal in der deutschsprachigen Wikipedia</a>.
|
||||
<br>Für alle Fragen wende dich gern an das <a href="https://de.wikipedia.org/wiki/Wikipedia:Förderung/Wikimedia_Deutschland">Team Ideenförderung</a>.
|
||||
<p>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from django.test import TestCase
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from .models import HonoraryCertificate
|
||||
|
||||
# Create your tests here.
|
||||
class TestGranted(TestCase):
|
||||
class TestWithoutLogin(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
#this supress an unwanted warning about missing root dir
|
||||
|
@ -28,3 +28,15 @@ class TestGranted(TestCase):
|
|||
'''test if /intern redirects to login page if not logged in'''
|
||||
response = self.client.get('/intern', follow=True)
|
||||
self.assertContains(response,'password')
|
||||
|
||||
class TestWithLogin(TestCase):
|
||||
# fixture = ['testfixture']
|
||||
|
||||
def setUp(self):
|
||||
User.objects.create_superuser('testuser', 'nomail@nomail.com', 'testpasswd')
|
||||
|
||||
def test_access(self):
|
||||
'''test if /intern gives an answer'''
|
||||
self.assertEqual(self.client.login(username='testuser', password='testpasswd'), True)
|
||||
response = self.client.get('/intern')
|
||||
self.assertContains(response,'Übersicht aller Förderangebote')
|
||||
|
|
Loading…
Reference in a new issue