Ticket #7498: dj-foreignkey-typecheck-testcase.patch

File dj-foreignkey-typecheck-testcase.patch, 673 bytes (added by Kenneth Arnold, 16 years ago)

Test

  • regressiontests/many_to_one_regress/models.py

     
    7373    ...
    7474ValueError: Cannot assign "<First: First object>": "Child.parent" must be a "Parent" instance.
    7575
     76>>> c2 = Child.objects.create(name="Grandchild", parent=c)
     77Traceback (most recent call last):
     78    ...
     79TypeError: Invalid value: 'parent' should be a <class 'regressiontests.many_to_one_regress.models.Parent'> instance, not a <class 'regressiontests.many_to_one_regress.models.Child'>
     80
    7681"""}
Back to Top