Ticket #10103: fix_model_form_doctest_with_dict_literal.diff

File fix_model_form_doctest_with_dict_literal.diff, 818 bytes (added by Leo Soto M., 15 years ago)
  • tests/modeltests/model_forms/models.py

    diff -r ee985e6cf9f1 tests/modeltests/model_forms/models.py
    a b  
    12851285>>> form = ExplicitPKForm({'key': u'key1', 'desc': u''})
    12861286>>> form.is_valid()
    12871287False
    1288 >>> form.errors
    1289 {'__all__': [u'Explicit pk with this Key and Desc already exists.'], 'key': [u'Explicit pk with this Key already exists.'], 'desc': [u'Explicit pk with this Desc already exists.']}
     1288>>> sorted(form.errors.items())
     1289[('__all__', [u'Explicit pk with this Key and Desc already exists.']), ('desc', [u'Explicit pk with this Desc already exists.']), ('key', [u'Explicit pk with this Key already exists.'])]
    12901290
    12911291# Choices on CharField and IntegerField
    12921292>>> class ArticleForm(ModelForm):
Back to Top