示例#1
0
 def test_has_exists_badwords(self):
     self.assert_(Antimat.has_exists_badwords(self.test_text))
示例#2
0
 def test_collect_badword(self):
     self.assertEqual(Antimat.collect_badwords(self.test_text), {'КОРОВА'})
示例#3
0
 def test_replace(self):
     self.assertEqual(Antimat.replace_badwords(self.test_text), self.replaced_text)
示例#4
0
from django.db import models

from django_antimat import Antimat


class TestAntimat(models.Model):
    text = models.TextField(null=True)


Antimat.install(TestAntimat, 'text')