Skip to content

Commit 6057db4

Browse files
committedOct 1, 2015
rename url_replace -> url_get_params_replace
1 parent 6288c4d commit 6057db4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎templatetags/url_replace.py ‎templatetags/url_get_params_replace.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
@register.simple_tag(takes_context=True)
7-
def url_replace(context, field, value):
7+
def url_get_params_replace(context, field, value):
88
""" The idea here is to take a GET dict and replace one value in the
99
GET dict (or create it if it doesn't exist) and then return the encoded
1010
value. Useful for pagination.

‎tests.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ def fake_context(self, get_dict):
120120
'request': factory.get('/', data=get_dict)
121121
}
122122

123-
def test_url_replace_templatetags_with_field_not_present(self):
124-
from templatetags.url_replace import url_replace
125-
path = url_replace(self.fake_context({'q': 'x'}), 'page', '3')
123+
def test_url_get_params_replace_templatetags_with_field_not_present(self):
124+
from templatetags.url_get_params_replace import url_get_params_replace
125+
path = url_get_params_replace(self.fake_context({'q': 'x'}), 'page', '3')
126126
self.assertEquals('q=x&page=3', path)
127127

128-
def test_url_replace_templatetags_with_field_present(self):
129-
from templatetags.url_replace import url_replace
130-
path = url_replace(self.fake_context({'q': 'x', 'page': '1'}), 'page', '3')
128+
def test_url_get_params_replace_templatetags_with_field_present(self):
129+
from templatetags.url_get_params_replace import url_get_params_replace
130+
path = url_get_params_replace(self.fake_context({'q': 'x', 'page': '1'}), 'page', '3')
131131
self.assertEquals('q=x&page=3', path)
132132

133133
def test_ip_address_range_field_validator(self):

0 commit comments

Comments
 (0)