Example #1
0
 def test_with_query_string(self):
     context = {}
     context["request"] = RequestFactory().get("/page/?foo=bar&bar=baz")
     result = change_query_string(context)
     assert result == "/page/?foo=bar&bar=baz"
Example #2
0
 def test_change_query_string(self):
     context = {}
     context["request"] = RequestFactory().get("/page/?foo=bar")
     result = change_query_string(context, foo="else")
     assert result == "/page/?foo=else"
Example #3
0
 def test_root_url_no_query_string(self):
     context = {}
     context["request"] = RequestFactory().get("/")
     result = change_query_string(context)
     assert result == "/"
Example #4
0
 def test_with_path_no_query_string(self):
     context = {}
     context["request"] = RequestFactory().get("/page/")
     result = change_query_string(context)
     assert result == "/page/"
Example #5
0
 def test_remove_query_string(self):
     context = {}
     context['request'] = RequestFactory().get('/page/?foo=bar')
     result = change_query_string(context, foo=None)
     assert result == '/page/'
Example #6
0
 def test_change_query_without_base(self):
     context = {}
     context['request'] = RequestFactory().get('/page/?foo=bar')
     result = change_query_string(context, foo='else', _no_base=True)
     assert result == '?foo=else'
Example #7
0
 def test_with_path_no_query_string(self):
     context = {}
     context['request'] = RequestFactory().get('/page/')
     result = change_query_string(context)
     assert result == '/page/'
Example #8
0
 def test_with_path_no_query_string(self):
     context = {}
     context['request'] = RequestFactory().get('/page/')
     result = change_query_string(context)
     assert result == '/page/'
Example #9
0
 def test_change_query_without_base(self):
     context = {}
     context['request'] = RequestFactory().get('/page/?foo=bar')
     result = change_query_string(context, foo='else', _no_base=True)
     assert result == '?foo=else'
Example #10
0
 def test_root_url_no_query_string(self):
     context = {}
     context['request'] = RequestFactory().get('/')
     result = change_query_string(context)
     assert result == '/'
Example #11
0
 def test_remove_leave_some(self):
     context = {}
     context['request'] = RequestFactory().get('/page/?foo=bar&other=thing')
     result = change_query_string(context, foo=None)
     assert result == '/page/?other=thing'
Example #12
0
 def test_change_query_string(self):
     context = {}
     context['request'] = RequestFactory().get('/page/?foo=bar')
     result = change_query_string(context, foo='else')
     assert result == '/page/?foo=else'
Example #13
0
 def test_with_query_string(self):
     context = {}
     context['request'] = RequestFactory().get('/page/?foo=bar&bar=baz')
     result = change_query_string(context)
     assert result == '/page/?foo=bar&bar=baz'
Example #14
0
 def test_remove_leave_some(self):
     context = {}
     context["request"] = RequestFactory().get("/page/?foo=bar&other=thing")
     result = change_query_string(context, foo=None)
     assert result == "/page/?other=thing"
Example #15
0
 def test_with_query_string(self):
     context = {}
     context['request'] = RequestFactory().get('/page/?foo=bar&bar=baz')
     result = change_query_string(context)
     assert result == '/page/?foo=bar&bar=baz'
Example #16
0
 def test_change_query_without_base(self):
     context = {}
     context["request"] = RequestFactory().get("/page/?foo=bar")
     result = change_query_string(context, foo="else", _no_base=True)
     assert result == "?foo=else"
Example #17
0
 def test_root_url_no_query_string(self):
     context = {}
     context['request'] = RequestFactory().get('/')
     result = change_query_string(context)
     assert result == '/'