def test_not_implemented_error(self): with self.assertRaises(NotImplementedError): Colour()
"admin/login.html", ] # '10 hours of'... SPAM_URLS = [spam for spam in SPAM_ENUMS] # check if any settings vars have been included to add to the # list of routes or urls if hasattr(settings, "SPAM_ROUTES"): SPAM_ROUTES += settings.SPAM_ROUTES # check for excluded routes if hasattr(settings, "EXCLUDED_ROUTES"): for route in settings.EXCLUDED_ROUTES: if route in SPAM_ROUTES: SPAM_ROUTES.remove(route) else: print( Colour.text( 'Warning: "' + route + '" is not included in django_spam.SPAM_ROUTES.', "warn", ) ) # NOTE: temp disbaling custom routes # if hasattr(settings, "SPAM_URLS"): # SPAM_URLS += settings.SPAM_URLS
def test_warn_text(self): warn_text = Colour.text("Warn text.", "warn") self.assertIn("Warn text.", warn_text)
def test_no_status_text(self): warn_text = Colour.text("Warn text.") # pylint: disable=no-value-for-parameter self.assertIn("Warn text.", warn_text)
def test_ok_text(self): ok_text = Colour.text("Ok text.", "ok") self.assertIn("Ok text.", ok_text)
def test_fail_text(self): fail_text = Colour.text("Fail text.", "fail") self.assertIn("Fail text.", fail_text)
def test_warn_text(self): warn_text = Colour.text('Warn text.', 'warn') self.assertIn('Warn text.', warn_text)
def test_ok_text(self): ok_text = Colour.text('Ok text.', 'ok') self.assertIn('Ok text.', ok_text)
def test_fail_text(self): fail_text = Colour.text('Fail text.', 'fail') self.assertIn('Fail text.', fail_text)