예제 #1
0
def single_author(request, author_id):
    author = get_object_or_404(Author, pk=author_id)
    return render_dictionary(author)
예제 #2
0
 def test_none_object_renders_empty_dict(self):
     response = render_dictionary(None)
     self.assertContains(response, '<dict></dict>')
예제 #3
0
 def test_dict_renders_as_dict(self):
     response = render_dictionary({'foo': 42})
     self.assertContains(response, '<dict><key>foo</key><integer>42</integer></dict>')
예제 #4
0
 def test_empty_dict_renders_empty_dict(self):
     response = render_dictionary({})
     self.assertContains(response, '<dict></dict>')