  class Comment(models.Model):
      pass
  
  
  @python_2_unicode_compatible
  class Book(models.Model):
      title = models.CharField(max_length=100, db_index=True)
      comments = models.ManyToManyField(Comment)
 
</s> remove from django.utils.encoding import python_2_unicode_compatible
 </s> add  </s> remove @python_2_unicode_compatible
 </s> add  </s> remove @python_2_unicode_compatible
class BrokenArticle(models.Model):
    headline = models.CharField(max_length=100)
    pub_date = models.DateTimeField()

    def __unicode__(self):      # instead of __str__
        return self.headline

 </s> add  </s> remove from django.utils.encoding import force_bytes, force_text, filepath_to_uri
 </s> add from django.utils.encoding import (force_bytes, force_text, filepath_to_uri,
        python_2_unicode_compatible) </s> remove from .models import Article, BrokenArticle, InternationalArticle
 </s> add from .models import Article, InternationalArticle
  class Comment(models.Model):
      pass
  
  

  class Book(models.Model):
      title = models.CharField(max_length=100, db_index=True)
      comments = models.ManyToManyField(Comment)
keep keep keep keep replace keep keep keep
 Fixed #21198 -- Prevented invalid use of @python_2_unicode_compatible.

Thanks jpic for the report and chmodas for working on a patch.

Reverts 2ea80b94. Refs #19362. 
tests/commands_sql/models.py