Restructured everything.

This commit is contained in:
2019-10-08 14:50:10 +02:00
parent 5336de4959
commit 587c2849b6
46 changed files with 102 additions and 328 deletions

View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import socket
from django.test import SimpleTestCase
class DjangoAdminTestCase(SimpleTestCase):
def test_djangoadmin(self):
response = self.client.get('/djangoadmin', follow=True)
self.assertContains(response, 'Django administration')
class RootTestCase(SimpleTestCase):
def setUp(self):
super(RootTestCase, self).setUp()
self.response = self.client.get('/')
def test_root_template(self):
response = self.response
self.assertTemplateUsed(response, 'base/root.html')
def test_root_context(self):
response = self.response
self.assertIn('hostname', response.context)
hostname = socket.gethostname()
self.assertEqual(response.context['hostname'], hostname)
def test_root_content(self):
response = self.response
hostname = socket.gethostname().capitalize()
self.assertContains(response, hostname)