Renamed Request.from_path_with_query_string() to Request.fake()

This commit is contained in:
Simon Willison 2019-06-23 16:49:57 -07:00
commit eba15fb5a8
2 changed files with 6 additions and 8 deletions

View file

@ -53,7 +53,7 @@ def test_urlsafe_components(path, expected):
],
)
def test_path_with_added_args(path, added_args, expected):
request = Request.from_path_with_query_string(path)
request = Request.fake(path)
actual = utils.path_with_added_args(request, added_args)
assert expected == actual
@ -67,11 +67,11 @@ def test_path_with_added_args(path, added_args, expected):
],
)
def test_path_with_removed_args(path, args, expected):
request = Request.from_path_with_query_string(path)
request = Request.fake(path)
actual = utils.path_with_removed_args(request, args)
assert expected == actual
# Run the test again but this time use the path= argument
request = Request.from_path_with_query_string("/")
request = Request.fake("/")
actual = utils.path_with_removed_args(request, args, path=path)
assert expected == actual
@ -84,7 +84,7 @@ def test_path_with_removed_args(path, args, expected):
],
)
def test_path_with_replaced_args(path, args, expected):
request = Request.from_path_with_query_string(path)
request = Request.fake(path)
actual = utils.path_with_replaced_args(request, args)
assert expected == actual
@ -363,7 +363,7 @@ def test_table_columns():
],
)
def test_path_with_format(path, format, extra_qs, expected):
request = Request.from_path_with_query_string(path)
request = Request.fake(path)
actual = utils.path_with_format(request, format, extra_qs)
assert expected == actual