Django

Code

Changeset 5181

Show
Ignore:
Timestamp:
05/10/07 08:46:15 (1 year ago)
Author:
russellm
Message:

Improved error reporting for assertions where there are no form errors, or a non-existent field has been provided. Also created a test client regression test, to hold the tests validating the failure cases of the TestCase? assertions.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/modeltests/test_client/models.py

    r5179 r5181  
    3535        self.assertEqual(response.template.name, 'GET Template') 
    3636 
    37     def test_no_template_view(self): 
    38         "Template usage assertions work then templates aren't in use" 
    39         response = self.client.get('/test_client/no_template_view/') 
    40  
    41         # Check that the no template case doesn't mess with the template assertions 
    42         self.assertTemplateNotUsed(response, 'GET Template') 
    43          
    4437    def test_get_post_view(self): 
    4538        "GET a view that normally expects POSTs" 
  • django/trunk/tests/modeltests/test_client/urls.py

    r5179 r5181  
    44 
    55urlpatterns = patterns('', 
    6     (r'^no_template_view/$', views.no_template_view), 
    76    (r'^get_view/$', views.get_view), 
    87    (r'^post_view/$', views.post_view), 
  • django/trunk/tests/modeltests/test_client/views.py

    r5179 r5181  
    77from django.newforms import fields 
    88from django.shortcuts import render_to_response 
    9  
    10 def no_template_view(request): 
    11     "A simple view that expects a GET request, and returns a rendered template" 
    12     return HttpResponse("No template used") 
    139 
    1410def get_view(request): 
  • django/trunk/tests/urls.py

    r4659 r5181  
    44    # test_client modeltest urls 
    55    (r'^test_client/', include('modeltests.test_client.urls')), 
     6    (r'^test_client_regress/', include('regressiontests.test_client_regress.urls')), 
    67 
    78    # Always provide the auth system login and logout views