def test_divide(self): self.assertJson(query.divide(1), '{"divide":1}') self.assertJson(query.divide(1, 2, 3), '{"divide":[1,2,3]}') self.assertJson(query.divide([1, 2, 3]), '{"divide":[1,2,3]}')
def test_divide(self): self.assertEqual(self._q(query.divide(2.0, 3, 5)), 2 / 15) self.assertEqual(self._q(query.divide(2)), 2) self._assert_bad_query(query.divide(1, 0)) self._assert_bad_query(query.divide())