Skip to content

Commit 2f1318b

Browse files
andrewgy8m000
authored andcommitted
Add docs on transactions when depending on the results of the actor (Bogdanp#178)
1 parent 05948ee commit 2f1318b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,12 @@ def test_customers_can_be_emailed(transactional_db, broker, worker, mailoutbox):
194194
assert mailoutbox[0].subject == "Welcome Jim!"
195195
```
196196

197+
198+
> [!NOTE]
199+
> If your tests rely on the results of the actor, you may experience inconsistent results. Due to the nature of the worker and test running in seperate threads, the test DB state may be different.
200+
>
201+
> To solve this you need to add the addtional `@pytest.mark.django_db(transaction=True)` decorator.
202+
197203
#### Using unittest
198204

199205
A simple test case has been provided that will automatically set up the

0 commit comments

Comments
 (0)