It would make sure no databases get written to within the block.
--
Ticket URL: <https://code.djangoproject.com/ticket/25062>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Why not just use this?
{{{
with self.assertNumQueries(0):
# some code
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25062#comment:1>
Comment (by timgraham):
I think the distinction here is that read queries are allowed, but not
writes. I'm curious about the use case. There is #22492 which proposes a
way to prohibit queries in a given code block. Perhaps that idea could be
extended to prohibit write queries in a block. That may be less fragile
than a test assertion.
--
Ticket URL: <https://code.djangoproject.com/ticket/25062#comment:2>
* status: new => closed
* resolution: => wontfix
Comment:
Closing absent follow up from the reporter.
--
Ticket URL: <https://code.djangoproject.com/ticket/25062#comment:3>