Fix broken tests

This commit is contained in:
Jan Tuomi
2017-09-29 00:05:17 +03:00
parent bfc462a332
commit 4099e5fa24
4 changed files with 13 additions and 7 deletions
+6 -4
View File
@@ -1,11 +1,13 @@
"""File containing Infoscreen tests."""
from django.test import TestCase
from django.test import TestCase, Client
from infoscreen.models import Rotation
from infoscreen.models import SossoInfoItem
from django.http import HttpRequest
import infoscreen.views
import logging
class InfoscreenTestCase(TestCase):
"""Test cases for testing infoscreen methods."""
@@ -14,6 +16,7 @@ class InfoscreenTestCase(TestCase):
"""Create some dummy models."""
Rotation.objects.create(name="test_rot")
SossoInfoItem.objects.create()
self.c = Client()
def test_rotation_created(self):
"""Check if the dummy model actually exists."""
@@ -32,7 +35,6 @@ class InfoscreenTestCase(TestCase):
That would mean that something meaningful has been included
in the response.
"""
req = HttpRequest()
resp = infoscreen.views.info_items(req)
content = resp.content.decode('utf-8')
resp = self.c.get('/infoscreen/items')
content = resp.json()
self.assertTrue(len(content) > 0)