#20004: move test helpers out of TransactionTestCase
--------------------------------------+---------------------
     Reporter:  zalew                 |      Owner:  zalew
         Type:  Cleanup/optimization  |     Status:  new
    Component:  Testing framework     |    Version:  1.5
     Severity:  Normal                |   Keywords:  testing
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+---------------------
 django.test.testcases.TestCase inherits from TransactionTestCase, so when
 django.db is not used in the project, it complains during testing about
 "ImproperlyConfigured: settings.DATABASES". A solution is to use
 SimpleTestCase (which TransactionTestCase inherits from), but this class
 doesn't contain the useful test helpers currently located in
 TransactionTestCase, which aren't in any way related to db handling:

 * assertRedirects
 * assert(Not)Contains
 * assertFormError
 * assertTemplate(Not)Used
 * _urlconf_setup(teardown).

 Proposal: move them out either to SimpleTestCase, or a separate class
 other tests (including TransactionTestCase) can inherit from, so they can
 be used in non-db test cases.

 ref: https://github.com/django/django/blob/master/django/test/testcases.py

-- 
Ticket URL: <https://code.djangoproject.com/ticket/20004>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to