WMDE
/
eva
forked from tohe/eva
7
1
Fork 0
eva/evapp/tests.py

38 lines
1.2 KiB
Python
Raw Normal View History

2020-12-23 10:42:57 +00:00
from django.test import TestCase
2021-09-13 13:32:16 +00:00
# import unittest
from django.test import Client
2020-12-23 10:42:57 +00:00
2021-09-13 13:32:16 +00:00
from django.contrib.auth.models import User
#from django.urls import reverse
# class LoginTestCase(unittest.TestCase):
# def setUp(self):
# self.client = Client()
# self.user = User.objects.create_user('vladimir', 'vladimir@reiherzehe.com', 'reiherzehe')
#
# def testLogin(self):
# self.client.login(username='vladimir', password='reiherzehe')
# response = self.client.get('accounts/')
# self.assertEqual(response.status_code, 200)
class SimpleTest(TestCase):
def setUp(self):
#User.objects.create_superuser('testuser', 'nomail@nomail.com', 'testpasswd')
# Every test needs a client.
self.client = Client()
def test_details(self):
# Issue a GET request.
response = self.client.get('/')
# Check that the response is 200 OK.
self.assertEqual(response.status_code, 302)
# print(response.url)
#
response2 = self.client.get(response.url)
# # print(response2.content)
#
self.assertContains( response2, 'Bitte via Wolke einloggen:', status_code=200)