Ticket #11191: 11191-string-pk-r10837.diff

File 11191-string-pk-r10837.diff, 1.1 KB (added by Tai Lee, 15 years ago)

Failing test case.

  • tests/regressiontests/admin_views/tests.py

     
    6363
    6464    def testBasicEditGet(self):
    6565        """
    66         A smoke test to ensureGET on the change_view works.
     66        A smoke test to ensure GET on the change_view works.
    6767        """
    6868        response = self.client.get('/test_admin/%s/admin_views/section/1/' % self.urlbit)
    6969        self.failUnlessEqual(response.status_code, 200)
    7070
     71    def testBasicEditGetStringPK(self):
     72        """
     73        A smoke test to ensure GET on the change_view works (returns an HTTP
     74        404 error, see #11191) when passing a string as the PK argument for a
     75        model with an integer PK field.
     76        """
     77        response = self.client.get('/test_admin/%s/admin_views/section/abc/' % self.urlbit)
     78        self.failUnlessEqual(response.status_code, 404)
     79
    7180    def testBasicAddPost(self):
    7281        """
    7382        A smoke test to ensure POST on add_view works.
Back to Top