36👍
✅
According to the documentation:
Model.__str__()
The
__str__()
method is called whenever you call
str()
on an object.
You need to call str()
on the model instance:
self.assertEqual(str(work), work.title)
- Django – Import views from separate apps
- Sometimes request.session.session_key is None
- Error Map Keys Must be unique while using YAML extension field in docker compose for django application
- Django rest framework: 'create( )' NotImplementedError when making Http POST request
Source:stackexchange.com