'Test COMMENTS_ALLOW_PROFANITIES and PROFANITIES_LIST settings'

def testProfanities(self):

    a = Article.objects.get(pk=1)
    d = self.getValidData(a)
    saved = (settings.PROFANITIES_LIST, settings.COMMENTS_ALLOW_PROFANITIES)
    settings.PROFANITIES_LIST = ['rooster']
    settings.COMMENTS_ALLOW_PROFANITIES = False
    f = CommentForm(a, data=dict(d, comment='What    a    rooster!'))
    self.assertFalse(f.is_valid())
    settings.COMMENTS_ALLOW_PROFANITIES = True
    f = CommentForm(a, data=dict(d, comment='What    a    rooster!'))
    self.assertTrue(f.is_valid())
    (settings.PROFANITIES_LIST, settings.COMMENTS_ALLOW_PROFANITIES) = saved
