diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-02-21 11:50:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-21 11:50:22 +0100 |
| commit | a269d8d1d8cec2f9ae7ecc0c97a41fcf9efee580 (patch) | |
| tree | e87b7e11f8b8797df540a2ab2965ef7c1d38457c | |
| parent | abe6c1f93eb112066691b590052704948789c60f (diff) | |
Removed obsolete test_get_or_create_raises_IntegrityError_plus_traceback() test.
This test was added in 31b1cbc623c246570e7301c0334df938d840638f, but is
no longer needed, as the fix was reverted in
746caf3ef821dbf7588797cb2600fa81b9df9d1d without any consequences, so
it now tests Python behavior rather than Django. Moreover, traceback
introspection is problematic for .pyc-only installations.
| -rw-r--r-- | tests/get_or_create/tests.py | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/tests/get_or_create/tests.py b/tests/get_or_create/tests.py index 0b56d6b1a2..5128335f56 100644 --- a/tests/get_or_create/tests.py +++ b/tests/get_or_create/tests.py @@ -227,19 +227,6 @@ class GetOrCreateTestsWithManualPKs(TestCase): ManualPrimaryKeyTest.objects.get_or_create(id=1, data="Different") self.assertEqual(ManualPrimaryKeyTest.objects.get(id=1).data, "Original") - def test_get_or_create_raises_IntegrityError_plus_traceback(self): - """ - get_or_create should raise IntegrityErrors with the full traceback. - This is tested by checking that a known method call is in the traceback. - We cannot use assertRaises here because we need to inspect - the actual traceback. Refs #16340. - """ - try: - ManualPrimaryKeyTest.objects.get_or_create(id=1, data="Different") - except IntegrityError: - formatted_traceback = traceback.format_exc() - self.assertIn("obj.save", formatted_traceback) - def test_savepoint_rollback(self): """ The database connection is still usable after a DatabaseError in |
