Re: Lost in why "UnicodeDecodeError" on changeset 6601

2007-10-31 Thread Malcolm Tredinnick
On Wed, 2007-10-31 at 20:35 +, mamcxyz wrote: > I don't call count manually. > > I'm doing: > > self.assertContains(self.response,u'Fallo el ingreso. Revise su clave > y usuario') > > assertContains is part of Django Test framework. ie: > > def assertContains(self, response, text, coun

Re: Lost in why "UnicodeDecodeError" on changeset 6601

2007-10-31 Thread mamcxyz
I don't call count manually. I'm doing: self.assertContains(self.response,u'Fallo el ingreso. Revise su clave y usuario') assertContains is part of Django Test framework. ie: def assertContains(self, response, text, count=None, status_code=200): """ Asserts that a response

Re: Lost in why "UnicodeDecodeError" on changeset 6601

2007-10-30 Thread Malcolm Tredinnick
On Tue, 2007-10-30 at 21:02 +, mamcxyz wrote: > I run this script and still get the errors. I think the problem is > elsewhere but how know? You've failed to look at my initial response to this: calling count() on a Unicode string with UTF-8 as the argument to count() won't work. Re-read all

Re: Lost in why "UnicodeDecodeError" on changeset 6601

2007-10-30 Thread mamcxyz
I run this script and still get the errors. I think the problem is elsewhere but how know? import codecs import os DIR = r"F:\Proyectos\Python\jhonWeb\shared\core\templates\core" arc=os.listdir(DIR) def write(file,text): # Open a UTF-8 file in read mode infile = codecs.open(file, "w",

Re: Lost in why "UnicodeDecodeError" on changeset 6601

2007-10-30 Thread mamcxyz
I use ultra-edit to change all files to utf8 and still get the same problem. About the questions: * The database is sqlite, created by the test runner * The type of text is unicode (u'http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---

Re: Lost in why "UnicodeDecodeError" on changeset 6601

2007-10-26 Thread Malcolm Tredinnick
On Sat, 2007-10-27 at 10:59 +1000, Malcolm Tredinnick wrote: [...] > I guess you know what you mean here, Jeremy, but just in case anybody > hits this in the archives: DEFAULT_CHARSET has nothing to do with the > internal bytestrings you pass to Django. It *only* affects the output > from the emai

Re: Lost in why "UnicodeDecodeError" on changeset 6601

2007-10-26 Thread Malcolm Tredinnick
On Fri, 2007-10-26 at 12:30 -0700, mamcxyz wrote: > I'm in the process to relaunch a django site. I build a dozen test > (finally!) for it and work correctly before. > > I update django to changeset 6601 and get a lot of errors. I fix > almost all of them except this: > > self.assertContains

Re: Lost in why "UnicodeDecodeError" on changeset 6601

2007-10-26 Thread Malcolm Tredinnick
On Fri, 2007-10-26 at 15:52 -0500, Jeremy Dunck wrote: > On 10/26/07, mamcxyz <[EMAIL PROTECTED]> wrote: > > > > > What's the type and value of "request.content"? What's the type and > > > value of "text" ? > > > > self.response= > > Err, please give the type and value of request.*content*, not

Re: Lost in why "UnicodeDecodeError" on changeset 6601

2007-10-26 Thread Jeremy Dunck
On 10/26/07, mamcxyz <[EMAIL PROTECTED]> wrote: > > > What's the type and value of "request.content"? What's the type and > > value of "text" ? > > self.response= Err, please give the type and value of request.*content*, not request. :) ... > 'content-type': ('Content-Type', 'text/html; charse

Re: Lost in why "UnicodeDecodeError" on changeset 6601

2007-10-26 Thread mamcxyz
> What's the type and value of "request.content"? What's the type and > value of "text" ? self.response= Doing a self.response.__dict__ I see this relevant values: 'content-type': ('Content-Type', 'text/html; charset=utf-8')} META:{'CONTENT_LENGTH': None, 'CONTENT_TYPE': 'text/html; charset=ut

Re: Lost in why "UnicodeDecodeError" on changeset 6601

2007-10-26 Thread Jeremy Dunck
On 10/26/07, mamcxyz <[EMAIL PROTECTED]> wrote: > > self.assertContains(self.response,u'Buscar:') > File "D:\Programacion\Python\Python24\lib\site-packages\django\test > \testcases.py", line 111, in assertContains > real_count = response.content.count(text) > UnicodeDecodeError: 'ascii'

Lost in why "UnicodeDecodeError" on changeset 6601

2007-10-26 Thread mamcxyz
I'm in the process to relaunch a django site. I build a dozen test (finally!) for it and work correctly before. I update django to changeset 6601 and get a lot of errors. I fix almost all of them except this: self.assertContains(self.response,u'Buscar:') File "D:\Programacion\Python\Python