mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 18:06:44 +00:00
transaction: Add 'savepoint=True' explicitly in tests, if used.
We create savepoint at a couple of places in backend tests to avoid rollback due to error raised within test's transaction. This commit explicitly adds 'savepoint=True' at those places.
This commit is contained in:
committed by
Tim Abbott
parent
fdcd518e26
commit
62b3e49075
@@ -1462,10 +1462,10 @@ Output:
|
||||
"invite_only": orjson.dumps(invite_only).decode(),
|
||||
}
|
||||
post_data.update(extra_post_data)
|
||||
# We wrap the API call with a 'transaction.atomic()' context
|
||||
# We wrap the API call with a 'transaction.atomic' context
|
||||
# manager as it helps us with NOT rolling back the entire
|
||||
# test transaction due to error responses.
|
||||
with transaction.atomic():
|
||||
with transaction.atomic(savepoint=True):
|
||||
result = self.api_post(
|
||||
user,
|
||||
"/api/v1/users/me/subscriptions",
|
||||
|
||||
Reference in New Issue
Block a user