Commits

Branko Vukelic committed d8a9309

Cover usage of del_params with no arguments

Comments (0)

Files changed (2)

tests/test_url_helper.py

         u.del_params('foo', 'baz')  # baz doesn't exist
         self.assertEqual(u.get_full_path(), '/foo/bar?bar=2')
 
+    def test_delete_multiple_without_arguments(self):
+        u = UrlHelper('/foo/bar?foo=1&bar=2')
+        u.del_params()
+        self.assertEqual(u.get_full_path(), '/foo/bar')

url_tools/helper.py

             pass # Fail silently
 
     def del_params(self, *params):
+        if not params:
+            self.query = {}
+            return
         for param in params:
             self.del_param(param)