Fix broken tests
This commit is contained in:
+6
-4
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user