django-dbdiff 0.7.3 release

I’m pretty lazy when it comes to writing tests for existing code, however, I’m even lazier when it comes to repetitive manual testing action, catching up with untested legacy code when I want a lot of coverage now, at least to ease upstream dependency upgrade testing. PHPUnit has had a DBUnit component since at least 10 years, and Junit too, I ported the concept to Django, first in several apps. Extracted it in the package to de-duplicating the data import tests from django-representatives and django-representatives-votes which is re-used in django-cities-light. [Read More]

django-dbdiff 0.6.0 release

django-dbdiff was released. It allows to exclude fields from tests with the new exclude parameter, ie::

        Fixture(
            'tweets/tests/after_create_retweet.json',
            models=[Tweet, Retweets],
        ).assertNoDiff(
            exclude={
                'tweets.tweet': ['datetime'],
                'tweets.retweets': ['datetime'],
            },
        }

This was initially requested by Nicolas Joyard for the Political Memory project.

Note that you shouldn’t use exclude for datetimes like in the above example, but instead use something like freezegun to force datetimes to an arbitrary fixture.

Django database testing

I’m pretty lazy when it comes to writing tests for existing code, however, I’m even lazier when it comes to repetitive manual testing action, we’ve got so much patches to review and test against so many versions of Python and Django, we need testing to be automated. This article presents a new Django app for testing the database. Java has DBunit and so does PHP, and django now has django-dbdiff. [Read More]