#27894: ATOMIC_REQUESTS setting isn't honored in second view called via
as_view()
------------------------------------------+------------------------
Reporter: Patrick Gerken | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------+------------------------
My database has ATOMIC_REQUESTS set to true.
My view "a" calls a view "b" that adds items to the database.
Then my view "a" raises an exception.
The items created in the view "b" are in the database.
I tried to write a proper test in django to reproduce the failure but I
think it is not working properly:
https://github.com/do3cc/django/commit/c9d7be5fde722b552dd4cb6276b1a1edf201f53f
I use a settings file that activates postgres and the test gets executed
but I suspect that I must use the client to access the views.
This is roughly the code in question:
https://github.com/do3cc/django/blob/c9d7be5fde722b552dd4cb6276b1a1edf201f53f/tests/transactions/tests.py#L31-L36
I'd love to write a better testcase for it but I am a bit lost at the
moment where to write that test case.
--
Ticket URL: <https://code.djangoproject.com/ticket/27894>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.be380fec9003d0058edad04268f4fd43%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.