Hi Folks,
i recently wrote some small mixins that are intented to be attached to CBV
like ListView, UpdateView, DetailView or even CreateView. The aim is to give
users only access to their data. Their in terms of ownership. As an Example
you have a Post model were a field called owner is a ForeignKey to 'auth.User'
as a basic example.
So the mixin does filtering the queryset and passes an additional parameter to
form classes where as an additional form Mixin then passes this down to the
model. So far so good. (see
http://pastebin.kde.org/pyzrouxfw)
Now my Question:
what would be the best solution to write a dedicated test against this mixin?
Would it be good or worth to create some Views loke the 4 above that inherits
also the Mixin and then test against this as a complete behaviour? Or better
mock it somehow differently?
I really appreaciate your suggestions!!
--
Best Regards
Sven