@@ -67,8 +67,8 @@ def test_no_exception_commit_transaction(self):
67
67
68
68
with self .assertNumQueries (1 ):
69
69
response = self .view (request )
70
- self . assertFalse ( transaction .get_rollback () )
71
- self . assertEqual ( response .status_code , status .HTTP_200_OK )
70
+ assert not transaction .get_rollback ()
71
+ assert response .status_code == status .HTTP_200_OK
72
72
assert BasicModel .objects .count () == 1
73
73
74
74
@@ -98,7 +98,7 @@ def test_generic_exception_delegate_transaction_management(self):
98
98
# 3 - release savepoint
99
99
with transaction .atomic ():
100
100
self .assertRaises (Exception , self .view , request )
101
- self . assertFalse ( transaction .get_rollback () )
101
+ assert not transaction .get_rollback ()
102
102
assert BasicModel .objects .count () == 1
103
103
104
104
@@ -128,9 +128,8 @@ def test_api_exception_rollback_transaction(self):
128
128
# 4 - release savepoint (django>=1.8 only)
129
129
with transaction .atomic ():
130
130
response = self .view (request )
131
- self .assertTrue (transaction .get_rollback ())
132
- self .assertEqual (response .status_code ,
133
- status .HTTP_500_INTERNAL_SERVER_ERROR )
131
+ assert transaction .get_rollback ()
132
+ assert response .status_code == status .HTTP_500_INTERNAL_SERVER_ERROR
134
133
assert BasicModel .objects .count () == 0
135
134
136
135
@@ -151,5 +150,4 @@ def test_api_exception_rollback_transaction_non_atomic_view(self):
151
150
152
151
# without checking connection.in_atomic_block view raises 500
153
152
# due attempt to rollback without transaction
154
- self .assertEqual (response .status_code ,
155
- status .HTTP_404_NOT_FOUND )
153
+ assert response .status_code == status .HTTP_404_NOT_FOUND
0 commit comments