Ticket #10738: deferred_model_contenttype_tests.diff

File deferred_model_contenttype_tests.diff, 611 bytes (added by tomasz.elendt, 16 years ago)
  • tests/modeltests/defer/models.py

     
    9898>>> Primary.objects.all()
    9999[<Primary: a new name>]
    100100
    101 
     101Model instances with deferred fields should have the same ContentType
     102>>> from django.contrib.contenttypes.models import ContentType
     103>>> ContentType.objects.get_for_model(qs[0]) is \
     104    ContentType.objects.get_for_model(qs.defer('name')[0]) is \
     105    ContentType.objects.get_for_model(qs.only('name')[0])
     106True
    102107"""}
Back to Top