Services Blog Français

django-dbdiff 0.6.0 release

| by jpic | python django best-practice django-dbdiff

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.

They trust us

Contact

logo