1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
"""
Ensures that django models with a __str__ method defined in an ancestor and
python_2_unicode_compatible decorator applied are flagged correctly as not
having explicitly defined __unicode__
"""
# pylint: disable=missing-docstring
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class BaseModel(models.Model):
def __str__(self):
return 'Foo'
class SomeModel(BaseModel): # [model-no-explicit-unicode]
pass
|