#30457: on_commit should be triggered in a TestCase
------------------------------------+------------------------------------
     Reporter:  Bernhard Mäder      |                    Owner:  nobody
         Type:  New feature         |                   Status:  new
    Component:  Documentation       |                  Version:  master
     Severity:  Normal              |               Resolution:
     Keywords:  on_commit TestCase  |             Triage Stage:  Accepted
    Has patch:  0                   |      Needs documentation:  0
  Needs tests:  0                   |  Patch needs improvement:  0
Easy pickings:  0                   |                    UI/UX:  0
------------------------------------+------------------------------------

Comment (by Bernhard Mäder):

 Hey Simon

 Thanks for your detailed explanation and the code snippet. I think it's
 actually an improvement to our solution as it doesn't require us to
 sprinkle the code with `run_commit_hooks()`, which may lead to confusing
 behavior such as hook running too late. So, I'm going to use that, thank
 you!

 I still think the default behaviour of TestCase is cumbersome for whenever
 one uses on_commit in a codebase. But, looking at the actual
 implementation, changing this seems like it would need changes in the
 connections themselves, which probably goes too far.

 And, I agree that your snippet would be great to have in the
 documentation. It would be cool if the behaviour would even be available
 as a config option (static member flag?) on `TestCase`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30457#comment:4>
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/064.0d44ae23b2cd1d01f780a609770f9465%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to