Skip to content

Commit 0fb5f38

Browse files
author
Lode Rosseel
committed
Add unblock test case when both flags are set
1 parent 3c986bf commit 0fb5f38

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/test_fixtures.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,11 @@ def test_unblock_with_block(self, django_db_blocker: DjangoDbBlocker) -> None:
750750
with django_db_blocker.unblock():
751751
Item.objects.exists()
752752

753+
def test_unblock_with_both_flags_raises_valueerror(self, django_db_blocker: DjangoDbBlocker) -> None:
754+
# When both sync_only and async_only are True, unblock should reject with ValueError
755+
with pytest.raises(ValueError, match="Cannot use both sync_only and async_only"):
756+
django_db_blocker.unblock(sync_only=True, async_only=True)
757+
753758

754759
def test_mail(mailoutbox) -> None:
755760
assert mailoutbox is mail.outbox # check that mail.outbox and fixture value is same object

0 commit comments

Comments
 (0)