Changes between Initial Version and Version 1 of Ticket #27128


Ignore:
Timestamp:
Aug 26, 2016, 8:08:09 AM (8 years ago)
Author:
Seti
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27128 – Description

    initial v1  
    3333If need another codes from my project, please tell about it
    3434
     35Update
     36Same error I had when tested a method "get_admin_url()" of the model Book with next a testing code
     37
     38{{{
     39def test_get_admin_url(self):
     40        self.client.force_login(self.active_superuser)
     41        response = self.client.get(self.book.get_admin_url())
     42        self.assertEqual(response.status_code, 200)
     43}}}
     44
     45Ending a traceback
     46
     47{{{
     48        if not num:
     49            raise self.model.DoesNotExist(
     50                "%s matching query does not exist." %
     51                self.model._meta.object_name
     52            )
     53        raise self.model.MultipleObjectsReturned(
     54            "get() returned more than one %s -- it returned %s!" %
     55>           (self.model._meta.object_name, num)
     56        )
     57E       apps.books.models.MultipleObjectsReturned: get() returned more than one Book -- it returned 3!
     58}}}
     59
Back to Top