<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1> About </h1>
<img src="{{MEDIA_URL}}resin.jpg" alt="Галоша" />
<p>
This tutorial has been put together by Marshwiggle
</p>
</body>
</html>
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
...E.EEE.....The module populate_rango does not exist
EThe module populate_rango does not exist
EThe module populate_rango does not exist
E
======================================================================
ERROR: test_about_contains_create_message (rango.tests.Chapter4ViewTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<MY_WORKING_PATH>/tango/tango_with_django_project/rango/tests.py", line 130, in test_about_contains_create_message
self.assertIn('This tutorial has been put together by', response.content)
File "/usr/lib/python3.5/unittest/case.py", line 1076, in assertIn
if member not in container:
TypeError: a bytes-like object is required, not 'str'
======================================================================
ERROR: test_does_about_contain_img (rango.tests.Chapter4ViewTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<MY_WORKING_PATH>/tango/tango_with_django_project/rango/tests.py", line 125, in test_does_about_contain_img
self.assertIn('img',response.content)
File "/usr/lib/python3.5/unittest/case.py", line 1076, in assertIn
if member not in container:
TypeError: a bytes-like object is required, not 'str'
======================================================================
ERROR: test_does_index_contain_img (rango.tests.Chapter4ViewTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<MY_WORKING_PATH>/tango/tango_with_django_project/rango/tests.py", line 114, in test_does_index_contain_img
self.assertIn('img',response.content)
File "/usr/lib/python3.5/unittest/case.py", line 1076, in assertIn
if member not in container:
TypeError: a bytes-like object is required, not 'str'
======================================================================
ERROR: test_index_contains_hello_message (rango.tests.Chapter4ViewTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<MY_WORKING_PATH>/tango/tango_with_django_project/rango/tests.py", line 109, in test_index_contains_hello_message
self.assertContains( response.content,'Rango says')
File "<MY_WORKING_PATH>/tango/rangoenv/lib/python3.5/site-packages/django/test/testcases.py", line 361, in assertContains
response, text, status_code, msg_prefix, html)
File "<MY_WORKING_PATH>/tango/rangoenv/lib/python3.5/site-packages/django/test/testcases.py", line 331, in _assert_contains
response.status_code, status_code,
AttributeError: 'bytes' object has no attribute 'status_code'
======================================================================
ERROR: test_python_cat_added (rango.tests.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<MY_WORKING_PATH>/tango/tango_with_django_project/rango/tests.py", line 91, in test_python_cat_added
cat = self.get_category('Python')
File "<MY_WORKING_PATH>/tango/tango_with_django_project/rango/tests.py", line 83, in get_category
from rango.models import Category
ImportError: cannot import name 'Category'
======================================================================
ERROR: test_python_cat_with_likes (rango.tests.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<MY_WORKING_PATH>/tango/tango_with_django_project/rango/tests.py", line 99, in test_python_cat_with_likes
cat = self.get_category('Python')
File "<MY_WORKING_PATH>/tango/tango_with_django_project/rango/tests.py", line 83, in get_category
from rango.models import Category
ImportError: cannot import name 'Category'
======================================================================
ERROR: test_python_cat_with_views (rango.tests.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<MY_WORKING_PATH>/tango/tango_with_django_project/rango/tests.py", line 95, in test_python_cat_with_views
cat = self.get_category('Python')
File "<MY_WORKING_PATH>/tango/tango_with_django_project/rango/tests.py", line 83, in get_category
from rango.models import Category
ImportError: cannot import name 'Category'
----------------------------------------------------------------------
Ran 16 tests in 0.089s
FAILED (errors=7)
Destroying test database for alias 'default'...
I've tested my app in the browser and it seems to be working, so perhaps, there are some bugs in the tests.
For example, 'test_about_contains_create_message' method of the 'AboutPageTests' object is almost identical to the method with the same name in the Chapter4ViewTests object, but it raises no error, and that's because it has a type hint (i.e. "b" character) before the string in the last line.