From 7b15af89cd246695cecdfb839267b0fd4c713468 Mon Sep 17 00:00:00 2001 From: ds Date: Sat, 26 Aug 2023 00:14:48 +0300 Subject: [PATCH] add test for #545 --- tests/unit/test_endpoint.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/unit/test_endpoint.py b/tests/unit/test_endpoint.py index 35ce340b..b26b9f82 100644 --- a/tests/unit/test_endpoint.py +++ b/tests/unit/test_endpoint.py @@ -24,6 +24,17 @@ def test_filter_invalid_pagination_args(self): with self.assertRaises(ValueError) as _: test_obj.filter(offset=1) + def test_filter_replace_none_with_null(self): + with patch( + "pynetbox.core.query.Request._make_call", return_value=Mock() + ): + api = Mock(base_url="http://localhost:8000/api") + app = Mock(name="test") + test_obj = Endpoint(api, app, "test") + test = test_obj.filter(name=None, id=0) + + self.assertEqual(test.request.filters, {"name": "null", "id": 0}) + def test_all_invalid_pagination_args(self): api = Mock(base_url="http://localhost:8000/api")