Fix Exception-catching regarding <class TypeError> in modeltests.get_or_create

Issue #46 on hold
Nate Margono created an issue

{{{

!python


File "/home/nm/django-dev/django-3k/build/tests/modeltests/get_or_create/models.py", line ?, in modeltests.get_or_create.models.test.API_TESTS Failed example: try: p, created = Person.objects.get_or_create(first_name='Tom', last_name='Smith') except Exception as e: if isinstance(e, IntegrityError): print("Pass") else: print("Fail with %s" % type(e)) Expected: Pass Got: Fail with <class 'TypeError'>


File "/home/nm/django-dev/django-3k/build/tests/modeltests/get_or_create/models.py", line ?, in modeltests.get_or_create.models.test.API_TESTS Failed example: try: m, created = ManualPrimaryKeyTest.objects.get_or_create(id=1, data='Different') except Exception as e: if isinstance(e, IntegrityError): print("Pass") else: print("Fail with %s" % type(e)) Expected: Pass Got: Fail with <class 'TypeError'>


}}}

Comments (1)

  1. Nate Margono reporter

    This issue is closely related to issue #48, which Andrew has worked on for quite a while, so I'm going to put it on hold until it's fixed and run the test again.

  2. Log in to comment