r4fek / django-cassandra-engine

Django Cassandra Engine - the Cassandra backend for Django
BSD 2-Clause "Simplified" License
365 stars 84 forks source link

The `TestCase` doesn't run non-cassandra fixture teardowns #25

Closed slurms closed 9 years ago

slurms commented 9 years ago

As django-cassandra-engine's TestCase._fixture_teardown method overrides Django's own, it ignores any databases other than its own. Similarly, no fixture setup is run either for non-cassandra databases.

r4fek commented 9 years ago

Hi @slurms, django_cassandra_engine.test.TestCase is meant to be used for testing only Cassandra models/views/functions etc. Why don't you use django.test.TestCase if you want to test non-cassandra stuff?

slurms commented 9 years ago

It just means that say, if you do have a database alias that uses sqlite3 or other backends AND also some database aliases that use django-cassandra-engine you can easily just inherit from django-cassanda-engine's TestCase and it all "just works" rather than any special casing.

slurms commented 9 years ago

Does that make sense? I mean, ideally we'd never even have to subclass Django's TestCase but that looks difficult to support with the current code here. Also, there's a flag (multi-db) that suppresses acting on all databases that we might need to support (https://github.com/django/django/blob/master/django/test/testcases.py#L811)?

r4fek commented 9 years ago

Yes, makes sense to me. I'll merge.

slurms commented 9 years ago

Thanks!

r4fek commented 9 years ago

And deployed to pypi.