diff --git a/rest_framework/templates/rest_framework/admin/dict_value.html b/rest_framework/templates/rest_framework/admin/dict_value.html
index e69de29bb..3392c901b 100644
--- a/rest_framework/templates/rest_framework/admin/dict_value.html
+++ b/rest_framework/templates/rest_framework/admin/dict_value.html
@@ -0,0 +1,11 @@
+{% load rest_framework %}
+
+
+ {% for key, value in value.items %}
+
+ {{ key|format_value }} |
+ {{ value|format_value }} |
+
+ {% endfor %}
+
+
diff --git a/tests/test_templatetags.py b/tests/test_templatetags.py
index 28390320b..cac1abf50 100644
--- a/tests/test_templatetags.py
+++ b/tests/test_templatetags.py
@@ -41,6 +41,9 @@ class TemplateTagTests(TestCase):
self.assertEqual(format_value(None), 'null
')
def test_format_value_hyperlink(self):
+ """
+ Tests format_value with a URL
+ """
url = 'http://url.com'
name = 'name_of_url'
hyperlink = Hyperlink(url, name)
@@ -54,6 +57,25 @@ class TemplateTagTests(TestCase):
self.assertEqual(format_value(list_items), '\n item1, item2, item3\n')
self.assertEqual(format_value([]), '\n\n')
+ def test_format_value_dict(self):
+ """
+ Tests format_value with a dict
+ """
+ test_dict = {'a': 'b'}
+ expected_dict_format = """
+ """
+ self.assertEqual(
+ format_html(format_value(test_dict)),
+ format_html(expected_dict_format)
+ )
+
def test_format_value_table(self):
"""
Tests format_value with a list of lists/dicts
@@ -84,20 +106,47 @@ class TemplateTagTests(TestCase):
expected_dict_format = """
-
- 0 |
- |
-
-
- 1 |
- |
-
-
- 2 |
- |
-
+
+ 0 |
+
+
+
+
+ item1 |
+ value1 |
+
+
+
+ |
+
+
+ 1 |
+
+
+
+
+ item2 |
+ value2 |
+
+
+
+ |
+
+
+ 2 |
+
+
+
+
+ item3 |
+ value3 |
+
+
+
+ |
+
- """
+ """
list_of_dicts = [{'item1': 'value1'}, {'item2': 'value2'}, {'item3': 'value3'}]
self.assertEqual(