Tim, thanks for the answer! 
I asked this question on the stackoverflow and other forums but no one 
knows the answer. 
I just started to learn django and python and It is still difficult for me 
to understand нow to apply this test to my code.
I tried to run the django test 
<https://docs.djangoproject.com/en/1.11/internals/contributing/writing-code/unit-tests/#quickstart>
 but 
received an error

======================================================================
>
> ERROR: test_unicode_file_name (i18n.test_extraction.BasicExtractorTests)
>
> ----------------------------------------------------------------------
>
> Traceback (most recent call last):
>
>   File "C:\www\django-test\django-repo\tests\i18n\test_extraction.py", 
>> line 219, in test_unicode_file_name
>
>     management.call_command('makemessages', locale=[LOCALE], verbosity=0)
>
>   File 
>> "c:\www\django-test\django-repo\django\core\management\__init__.py", line 
>> 142, in call_command
>
>     return command.execute(*args, **defaults)
>
>   File "c:\www\django-test\django-repo\django\core\management\base.py", 
>> line 334, in execute
>
>     output = self.handle(*args, **options)
>
>   File 
>> "c:\www\django-test\django-repo\django\core\management\commands\makemessages.py",
>>  
>> line 382, in handle
>
>     potfiles = self.build_potfiles()
>
>   File 
>> "c:\www\django-test\django-repo\django\core\management\commands\makemessages.py",
>>  
>> line 424, in build_potfiles
>
>     self.process_files(file_list)
>
>   File 
>> "c:\www\django-test\django-repo\django\core\management\commands\makemessages.py",
>>  
>> line 520, in process_files
>
>     self.process_locale_dir(locale_dir, files)
>
>   File 
>> "c:\www\django-test\django-repo\django\core\management\commands\makemessages.py",
>>  
>> line 584, in process_locale_dir
>
>     input_files_list.write(('\n'.join(input_files)))
>
>   File "C:\Program Files (x86)\Python36-32\lib\encodings\cp1251.py", line 
>> 19, in encode
>
>     return codecs.charmap_encode(input,self.errors,encoding_table)[0]
>
> UnicodeEncodeError: 'charmap' codec can't encode character '\xe9' in 
>> position 241: character maps to <undefined>
>
>
>> ======================================================================
>
> ERROR: test_strip_tags_files (utils_tests.test_html.TestUtilsHtml) 
>> (filename='strip_tags1.html')
>
> ----------------------------------------------------------------------
>
> Traceback (most recent call last):
>
>   File "C:\www\django-test\django-repo\tests\utils_tests\test_html.py", 
>> line 103, in test_strip_tags_files
>
>     content = fp.read()
>
>   File "C:\Program Files (x86)\Python36-32\lib\encodings\cp1251.py", line 
>> 23, in decode
>
>     return codecs.charmap_decode(input,self.errors,decoding_table)[0]
>
> UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 
>> 33114: character maps to <undefined>
>
>
>> ======================================================================
>
> ERROR: test_content_saving (file_storage.tests.ContentFileStorageTestCase)
>
> ----------------------------------------------------------------------
>
> Traceback (most recent call last):
>
>   File "C:\www\django-test\django-repo\tests\file_storage\tests.py", line 
>> 928, in test_content_saving
>
>     self.storage.save('unicode.txt', ContentFile("espa\xf1ol"))
>
>   File "c:\www\django-test\django-repo\django\core\files\storage.py", line 
>> 50, in save
>
>     return self._save(name, content)
>
>   File "c:\www\django-test\django-repo\django\core\files\storage.py", line 
>> 271, in _save
>
>     _file.write(chunk)
>
>   File "C:\Program Files (x86)\Python36-32\lib\encodings\cp1251.py", line 
>> 19, in encode
>
>     return codecs.charmap_encode(input,self.errors,encoding_table)[0]
>
> UnicodeEncodeError: 'charmap' codec can't encode character '\xf1' in 
>> position 4: character maps to <undefined>
>
>
>> ======================================================================
>
> FAIL: test_accent 
>> (dbshell.test_postgresql_psycopg2.PostgreSqlDbshellCommandTestCase)
>
> ----------------------------------------------------------------------
>
> Traceback (most recent call last):
>
>   File 
>> "C:\www\django-test\django-repo\tests\dbshell\test_postgresql_psycopg2.py", 
>> line 100, in test_accent
>
>     pgpass_string,
>
> AssertionError: Tuples differ: (['ps[32 chars]st', '-p', '444', 'dbname'], 
>> None) != (['ps[32 chars]st', '-p', '444', 'dbname'], 
>> 'somehost:444:dbname:r\xf4le:s\xe9same')
>
>
>> First differing element 1:
>
> None
>
> 'somehost:444:dbname:r\xf4le:s\xe9same'
>
>
>> - (['psql', '-U', 'r\xf4le', '-h', 'somehost', '-p', '444', 'dbname'], 
>> None)
>
> ?                                                                  ------
>
>
>> + (['psql', '-U', 'r\xf4le', '-h', 'somehost', '-p', '444', 'dbname'],
>
> +  'somehost:444:dbname:r\xf4le:s\xe9same')
>
>
>> ======================================================================
>
> FAIL: test_all (admin_scripts.tests.DiffSettings)
>
> The all option also shows settings with the default value.
>
> ----------------------------------------------------------------------
>
> Traceback (most recent call last):
>
>   File "C:\www\django-test\django-repo\tests\admin_scripts\tests.py", line 
>> 2155, in test_all
>
>     self.assertNoOutput(err)
>
>   File "C:\www\django-test\django-repo\tests\admin_scripts\tests.py", line 
>> 189, in assertNoOutput
>
>     self.assertEqual(len(stream), 0, "Stream should be empty: actually 
>> contains '%s'" % stream)
>
> AssertionError: 1073 != 0 : Stream should be empty: actually contains 
>> 'Traceback (most recent call last):
>
>   File "./manage.py", line 15, in <module>
>
>     execute_from_command_line(sys.argv)
>
>   File 
>> "C:\www\django-test\django-repo\django\core\management\__init__.py", line 
>> 366, in execute_from_command_line
>
>     utility.execute()
>
>   File 
>> "C:\www\django-test\django-repo\django\core\management\__init__.py", line 
>> 360, in execute
>
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>
>   File "C:\www\django-test\django-repo\django\core\management\base.py", 
>> line 289, in run_from_argv
>
>     self.execute(*args, **cmd_options)
>
>   File "C:\www\django-test\django-repo\django\core\management\base.py", 
>> line 343, in execute
>
>     self.stdout.write(output)
>
>   File "C:\www\django-test\django-repo\django\core\management\base.py", 
>> line 107, in write
>
>     self._out.write(style_func(msg))
>
>   File "C:\Program Files (x86)\Python36-32\lib\encodings\cp1251.py", line 
>> 19, in encode
>
>     return codecs.charmap_encode(input,self.errors,encoding_table)[0]
>
> UnicodeEncodeError: 'charmap' codec can't encode character '\xe5' in 
>> position 4887: character maps to <undefined>
>
> '
>
>
>> ======================================================================
>
> FAIL: test_unified_all (admin_scripts.tests.DiffSettings)
>
> ----------------------------------------------------------------------
>
> Traceback (most recent call last):
>
>   File "C:\www\django-test\django-repo\tests\admin_scripts\tests.py", line 
>> 2193, in test_unified_all
>
>     self.assertNoOutput(err)
>
>   File "C:\www\django-test\django-repo\tests\admin_scripts\tests.py", line 
>> 189, in assertNoOutput
>
>     self.assertEqual(len(stream), 0, "Stream should be empty: actually 
>> contains '%s'" % stream)
>
> AssertionError: 1073 != 0 : Stream should be empty: actually contains 
>> 'Traceback (most recent call last):
>
>   File "./manage.py", line 15, in <module>
>
>     execute_from_command_line(sys.argv)
>
>   File 
>> "C:\www\django-test\django-repo\django\core\management\__init__.py", line 
>> 366, in execute_from_command_line
>
>     utility.execute()
>
>   File 
>> "C:\www\django-test\django-repo\django\core\management\__init__.py", line 
>> 360, in execute
>
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>
>   File "C:\www\django-test\django-repo\django\core\management\base.py", 
>> line 289, in run_from_argv
>
>     self.execute(*args, **cmd_options)
>
>   File "C:\www\django-test\django-repo\django\core\management\base.py", 
>> line 343, in execute
>
>     self.stdout.write(output)
>
>   File "C:\www\django-test\django-repo\django\core\management\base.py", 
>> line 107, in write
>
>     self._out.write(style_func(msg))
>
>   File "C:\Program Files (x86)\Python36-32\lib\encodings\cp1251.py", line 
>> 19, in encode
>
>     return codecs.charmap_encode(input,self.errors,encoding_table)[0]
>
> UnicodeEncodeError: 'charmap' codec can't encode character '\xe5' in 
>> position 4817: character maps to <undefined>
>
> '
>
>
>> ----------------------------------------------------------------------
>
> Ran 11612 tests in 840.762s
>
>
>> FAILED (failures=3, errors=3, skipped=780, expected failures=4)
>
> Testing against Django installed in 'c:\www\django-test\django-repo\django'
>
> Creating test database for alias 'default'...
>
> Creating test database for alias 'other'...
>
> System check identified no issues (14 silenced).
>
> Destroying test database for alias 'default'...
>
> Destroying test database for alias 'other'...
>
> (django-test)
>
>
I also tried to run the code from the test
settings.LOCALE_PATHS + [
path.join(
path.dirname(path.dirname(path.abspath(__file__))),
        'app3',
        'locale',
    ),
]
and also get the error

> can only concatenate tuple (not "list") to tuple
>
>  

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d5402080-40a5-4e0b-bd3d-980998353142%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to