RSSAmplifier

Michael Mior · Jan 14, 2012

Unit testing Django model mixins

0
Sign in to vote or save

This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.

I recently found myself having to unit test some model mixins and I thought I would share the technique I used in case anyone else finds it useful. You could just pick a model which uses the mixin and run the test on instances of that model. But the goal of a mixin is to provide reusable functionality independent of any model. Instead, we create a dummy model we can use for testing. The model…

Read on michael.mior.ca

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.