calebsmith / django-template-debug

A small collection of template tags for debugging and introspecting templates
BSD 3-Clause "New" or "Revised" License
74 stars 11 forks source link

Tests/Setup and bugfixes for newer Pythons/Djangos #30

Closed calebsmith closed 9 years ago

calebsmith commented 9 years ago

Fixes #25

The test setup is made to work generically with Django1.3 through 1.7 test runners (old discovery using init imports and new discovery using test_* names).

Greatly simplified the runtests module to basically do what 'manage.py test' does, but limit to the template_debug app. (Older Django's try to test contrib apps using the example.settings if manage.py test is used).

Fixes tests to work generically with different auth.user code in various Django versions. A more sane and correct approach would be to use a custom model for testing. However, contrib.auth makes quick and dirty integration tests easier since it has hooks into many things. I'd rather make the subject of how best to test this in a later release since several bug fixes are currently waiting for the 0.3.4 release.

Ideally, this work mostly paves the way forward for making the app testable in Django 1.3-1.7 and python 2.6-3.4 (for versions of Django where those pythons are supported)

jbradberry commented 9 years ago

These changes look reasonable, and I've verified that the tests pass. Ship it!