diff --git a/tests/test_templatetags.py b/tests/test_templatetags.py index f75dcbadb..ee9513ca0 100644 --- a/tests/test_templatetags.py +++ b/tests/test_templatetags.py @@ -3,6 +3,7 @@ from __future__ import unicode_literals from django.test import TestCase +from rest_framework.relations import Hyperlink from rest_framework.templatetags.rest_framework import ( add_nested_class, add_query_param, format_value, urlize_quoted_links ) @@ -30,6 +31,12 @@ class TemplateTagTests(TestCase): self.assertEqual(format_value(False), 'false') self.assertEqual(format_value(None), 'null') + def test_format_value_hyperlink(self): + url = 'http://url.com' + name = 'name_of_url' + hyperlink = Hyperlink(url, name) + self.assertEqual(format_value(hyperlink), '%s' % (url, name)) + def test_format_value_list(self): """ Tests format_value with a list of strings