def test_has_exists_badwords(self): self.assert_(Antimat.has_exists_badwords(self.test_text))
def test_collect_badword(self): self.assertEqual(Antimat.collect_badwords(self.test_text), {'КОРОВА'})
def test_replace(self): self.assertEqual(Antimat.replace_badwords(self.test_text), self.replaced_text)
from django.db import models from django_antimat import Antimat class TestAntimat(models.Model): text = models.TextField(null=True) Antimat.install(TestAntimat, 'text')