Hi sassman,

Since you mentioned TDD, I assume you are talking about unit tests. As with 
any matter in quality control, the more you can test, the better! 

In my opinion, you would need to provide atleast one testcase for each of 
the four CBV views. It is better to create a derived class in each case 
rather than mocking it.

Regards,
Arun

On Monday, January 6, 2014 12:01:30 AM UTC+5:30, sassman wrote:
>
> 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 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8125cbbb-f689-4db7-b3d1-4832c9a15aac%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to