Changes between Initial Version and Version 1 of Ticket #33906
- Timestamp:
- Aug 8, 2022, 3:46:51 AM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #33906 – Description
initial v1 1 1 Hello! I'm filing my first Django bug and hopefully it is meaningful: 2 2 3 When a db integrity error occurs in some test, the exception is captured by the test suite and following code in the test is executed. This is inconsistent with any other exception that might arise from test code execution.3 When a db integrity error occurs in some test, the exception is captured by the test suite and following code in the test is executed. This seems inconsistent with any other exception that might arise from test code execution. 4 4 It might be similar to the closed ticket https://code.djangoproject.com/ticket/14223 5 5 … … 40 40 # NammeErrorWouldRaiseHere 41 41 Article.objects.bulk_create(objs) # DB Integrity Error captured... 42 print('Hello Dear Django Coders!')42 print('Hello Dear Django Coders!') 43 43 self.assertEqual(1, 2) 44 44 }}} … … 61 61 AssertionError: 1 != 2 62 62 }}} 63 But when uncommenting the "NammeErrorWouldRaiseHere" , "Hello Dear Django Coders!'" is not printed, nor the last "AssertionError" is not executed. This seams confusing and inconsistent behavior.63 But when uncommenting the "NammeErrorWouldRaiseHere" , "Hello Dear Django Coders!'" is not printed, nor is the last "AssertionError" executed. This seems confusing and inconsistent behavior. 64 64 65 65 It appears on SQLite as well as with PsycoPg / PG. Furthermore, the exception can not be captured within the Code with a regular try-except. Following modification of the test will not print "Hello" :