def test_not_safe_bool(self): self.assertFalse(StringCleaner.safe_bool(False)) self.assertFalse(StringCleaner.safe_bool('False')) self.assertFalse(StringCleaner.safe_bool('0')) self.assertFalse(StringCleaner.safe_bool(None))
def test_safe_bool(self): self.assertTrue(StringCleaner.safe_bool('1')) self.assertTrue(StringCleaner.safe_bool('True')) self.assertTrue(StringCleaner.safe_bool(True)) self.assertTrue(StringCleaner.safe_bool('on'))