Hello,
I'm new to django (using it only for two weeks and I was reading
django tutorial, documentation and book for the first week).

I'm writing unit tests for my CMS similar to built-in flatpages CMS,
but with builtin i18n features and other things required for full-
fledged CMS.

I cannot use standard django test client because it doesn't work with
middleware intercepting 404 errors (I didn't investigate why, because
I've thought that testing view manually would be easier).
Unfortunately, I was wrong. When I'm trying to test i18n features,
response.content returns non-ascii text *doubly* encoded in utf-8.
First invocation of response.content.decode('utf-8') returns unicode
object that contains utf-8 encoded original string. I can find some
tricky way to decode unicode object again using struct module or
something, but I don't understand why django encodes content twice.
And how test client gains access to template context.

Will look at the sources meanwhile, but would be very grateful if
someone will explain.
Eugene


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to