diff --git a/input/tests/views.py b/input/tests/views.py index 723391c..5109466 100644 --- a/input/tests/views.py +++ b/input/tests/views.py @@ -1,11 +1,12 @@ import random +from django.forms import model_to_dict from django.shortcuts import resolve_url from django.test import TestCase from input.models import Library, TYPE_PROJ from input.utils.testing import create_superuser, login, request -from input.views import TYPES +from input.views import TYPES, ApplicationView PATHS = {TYPES[path].code: path for path in TYPES} CODES = list(PATHS) @@ -127,6 +128,12 @@ class AnonymousViewTestCase(TestCase): def test_extern_invalid_code(self): request(self, 'extern', args=['invalid'], status_code=404) + def test_unknown_name(self): + obj = Library(type=Library.TYPE) + data = model_to_dict(obj) + name = ApplicationView.get_recipient_name(obj, data) + + self.assertEqual(name, 'Unbekannt') class AuthenticatedViewTestCase(TestCase):