API: Allow to simulate check-ins (#6360)

* API: Allow to simulate check-ins

* Add missing file
This commit is contained in:
Raphael Michel
2026-08-07 18:59:01 +02:00
committed by GitHub
parent 4a28689690
commit d08216d8c5
7 changed files with 87 additions and 3 deletions
+9
View File
@@ -288,6 +288,15 @@ def get_deterministic_ordering(model, ordering):
return ordering
@contextlib.contextmanager
def conditional_atomic(do_atomic, **kwargs):
if do_atomic:
with transaction.atomic(**kwargs):
yield
else:
yield
class IgnoreOnSQLiteMixin:
# Mixin to allow defining PostgreSQL-specific indexes that will just not be created
# on SQLite. SQLite is supported for testing only anyways!