On 03/07/2013 01:32 PM, zalew wrote:
> I'm currently working on a project where I don't use db.* and I met a
> problem during testing. As django.test.testcases.TestCase [1] inherits
> from TransactionTestCase, it complains about "ImproperlyConfigured:
> settings.DATABASES". A solution is to fall back to SimpleTestCase (which
> TransactionTestCase inherits from), but this class doesn't contain
> useful test helpers, which aren't in any way related to db handling:
> 
> * assertRedirects
> * assert(Not)Contains
> * assertFormError
> * assertTemplate(Not)Used
> * _urlconf_setup(teardown).
> 
> Is there a reason why these functions were bound to a transaction
> handling test class instead of SimpleTestCase?
> 
> My proposal is to move them out either to SimpleTestCase, or a separate
> class other tests (including TransactionTestCase) can inherit from. I
> have experimentally written a SimpleTestCase based class for my needs,
> but I haven't yet tested it against the Django suite.

Sounds reasonable to me; those non-db-related helpers shouldn't need to
be on TransactionTestCase.

Carl

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" 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].
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to