how to test a signal that recived request and user objects?

0 views
Skip to first unread message

Viktor

unread,
Nov 24, 2009, 10:21:19 AM11/24/09
to Django users
hi,

I would like to write a signal handler that logs the user in when its
account gets activated.

My signal handler is registered with user_activated from django-
registration, and my initial guess was this:

def log_user_in(sender, **kwargs):
login(kwargs['request'], kwargs['user'])
user_activated.connect(log_user_in)

but some reason, this won't work. Could someone give me a hint on how
to debug this? As I prefer writing unit tests, the best would be an
example of how can I create a request object to call the above method.

thanks
V
Reply all
Reply to author
Forward
0 new messages