mirror of
https://github.com/django/django.git
synced 2025-09-12 07:02:46 +03:00
Removed obsolete test_get_or_create_raises_IntegrityError_plus_traceback() test.
This test was added in31b1cbc623
, but is no longer needed, as the fix was reverted in746caf3ef8
without any consequences, so it now tests Python behavior rather than Django. Moreover, traceback introspection is problematic for .pyc-only installations.
This commit is contained in:
parent
abe6c1f93e
commit
a269d8d1d8
|
@ -227,19 +227,6 @@ class GetOrCreateTestsWithManualPKs(TestCase):
|
||||||
ManualPrimaryKeyTest.objects.get_or_create(id=1, data="Different")
|
ManualPrimaryKeyTest.objects.get_or_create(id=1, data="Different")
|
||||||
self.assertEqual(ManualPrimaryKeyTest.objects.get(id=1).data, "Original")
|
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):
|
def test_savepoint_rollback(self):
|
||||||
"""
|
"""
|
||||||
The database connection is still usable after a DatabaseError in
|
The database connection is still usable after a DatabaseError in
|
||||||
|
|
Loading…
Reference in New Issue
Block a user