Ticket #24244: ticket_24244.diff

File ticket_24244.diff, 1.0 KB (added by Varun Sharma, 10 years ago)
  • tests/admin_views/tests.py

    diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
    index 7c299a4..4efba30 100644
    a b def test_logentry_get_admin_url(self):  
    23202320        logentry.content_type.model = "non-existent"
    23212321        self.assertEqual(logentry.get_admin_url(), None)
    23222322
     2323    def test_logentry_get_edited_object(self):
     2324        "LogEntry.get_edited_object returns the edited object of a given LogEntry object"
     2325        log_entry_model = "modelwithstringprimarykey"
     2326        logentry = LogEntry.objects.get(content_type__model__iexact=log_entry_model)
     2327        edited_obj = logentry.get_edited_object()
     2328        self.assertEqual(logentry.object_id, str(edited_obj.pk))
     2329
    23232330    def test_deleteconfirmation_link(self):
    23242331        "The link from the delete confirmation page referring back to the changeform of the object should be quoted"
    23252332        response = self.client.get(reverse('admin:admin_views_modelwithstringprimarykey_delete', args=(quote(self.pk),)))
Back to Top