~ubuntu-branches/ubuntu/saucy/python-django/saucy-updates

« back to all changes in this revision

Viewing changes to tests/regressiontests/generic_views/detail.py

  • Committer: Package Import Robot
  • Author(s): Luke Faraone, Jakub Wilk, Luke Faraone
  • Date: 2013-05-09 15:10:47 UTC
  • mfrom: (1.1.21) (4.4.27 sid)
  • Revision ID: package-import@ubuntu.com-20130509151047-aqv8d71oj9wvcv8c
Tags: 1.5.1-2
[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

[ Luke Faraone ]
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
from django.core.exceptions import ImproperlyConfigured
4
4
from django.test import TestCase
 
5
from django.views.generic.base import View
5
6
 
6
7
from .models import Artist, Author, Page
7
8
 
14
15
        res = self.client.get('/detail/obj/')
15
16
        self.assertEqual(res.status_code, 200)
16
17
        self.assertEqual(res.context['object'], {'foo': 'bar'})
 
18
        self.assertTrue(isinstance(res.context['view'], View))
17
19
        self.assertTemplateUsed(res, 'generic_views/detail.html')
18
20
 
19
21
    def test_detail_by_pk(self):
92
94
 
93
95
    def test_invalid_queryset(self):
94
96
        self.assertRaises(ImproperlyConfigured, self.client.get, '/detail/author/invalid/qs/')
 
97
 
 
98
    def test_non_model_object_with_meta(self):
 
99
        res = self.client.get('/detail/nonmodel/1/')
 
100
        self.assertEqual(res.status_code, 200)
 
101
        self.assertEqual(res.context['object'].id, "non_model_1")