Hi,
I realize this topic is in a gray zone between django-users and
django-developers, but I thought it'd be more fitting to post it here.

I needed to inject things into the session, and I'm not using regular  
sessions.
I have my own session framework*, but the testing framework is rather  
tightly
coupled with the built-in Django sessions.

All I want to do with it - for now - is to have a simple dict as the  
session of
the testing client.

Normally, I'd just subclass django.test.TestCase, and change the part  
I need to
change - simple programming! But this is more or less impossible with  
TestCase,
because the part that sets up the client object is TestCase.__call__,  
which also
contains other logics.

So for me to be able to override the class used for the client object,  
I would
have to *copy* the __call__ method from the actual .py file, paste and  
rewrite.
IMHO that's a pretty strong indication that modularization isn't at  
its best.
:-)

I'm not sure how to modularize this either. A first step would be  
moving the
line `self.client = Client()` from __call__ to _pre_setup. That way,  
one could
subclass and upcall, then replace. That's virtually impossible  
currently.

- Ludvig

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to