def test_python_condition_model(self): model_mock = Mock(spec=Model) model_mock.pk = 129 exact = Exact(model_mock) self.assertTrue(exact.met(model_mock)) self.assertTrue(exact.met("129")) self.assertTrue(exact.met(129))
def test_python_condition_model(self): model_mock = Mock(spec=Model) model_mock.pk = 129 model_mock_2 = Mock(spec=Model) model_mock_2.pk = 55 exact = Exact(model_mock) self.assertTrue(exact.met(model_mock)) self.assertTrue(exact.met("129")) self.assertTrue(exact.met(129)) self.assertFalse(exact.met(model_mock_2)) self.assertFalse(exact.met("185")) self.assertFalse(exact.met(19))
def test_js_format_date(self): exact = Exact(date(2000, 01, 01)) self.assertEqual(exact.get_js_format(), ["exact", "2000-01-01"])
def test_js_format_simple(self): exact = Exact(10) self.assertEqual(exact.get_js_format(), ["exact", "10"])
def test_python_condition_date(self): exact = Exact(date(2100, 10, 5)) self.assertTrue(exact.met("2100-10-05")) self.assertTrue(exact.met(date(2100, 10, 5))) self.assertFalse(exact.met("2100-11-05")) self.assertFalse(exact.met(date(2000, 4, 18)))
def test_python_condition(self): exact = Exact(5) self.assertTrue(exact.met(5)) self.assertTrue(exact.met("5")) self.assertFalse(exact.met(7)) self.assertFalse(exact.met("3"))