Skip to content

Commit

Permalink
fix(inclusion_connect): update inclusion_connect_url templatetag
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Sep 19, 2023
1 parent c50960d commit 5c88c6e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lacommunaute/forum/tests/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def test_has_not_liked_TOPIC_ANNOUNCE(self):
self.assertContains(response, '<i class="ri-heart-3-line me-1" aria-hidden="true"></i><span>0</span>')

def test_anonymous_like(self):
params = {"next_url": self.url}
params = {"next": self.url}
url = f"{reverse('inclusion_connect:authorize')}?{urlencode(params)}"

response = self.client.get(self.url)
Expand Down Expand Up @@ -352,7 +352,7 @@ def test_upvote_actions(self):

# anonymous
anonymous_html = (
'<a href="/inclusion_connect/authorize?next_url=%2Fforum%2F'
'<a href="/inclusion_connect/authorize?next=%2Fforum%2F'
f'{child_forum.slug}-{child_forum.pk}%2F%23{child_forum.pk}"'
' rel="nofollow"'
' class="btn btn-sm btn-ico-only btn-link btn-secondary" data-bs-toggle="tooltip" data-bs-placement="top"'
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/forum_conversation/tests/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def test_pluralized_likes(self):

def test_anonymous_like(self):
assign_perm("can_read_forum", AnonymousUser(), self.topic.forum)
params = {"next_url": self.url}
params = {"next": self.url}
url = f"{reverse('inclusion_connect:authorize')}?{urlencode(params)}"

response = self.client.get(self.url)
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/utils/templatetags/str_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def pluralizefr(value, arg="s"):
def inclusion_connect_url(next_url, anchor=None):
if anchor:
next_url = f"{next_url}#{anchor}"
params = {"next_url": next_url}
params = {"next": next_url}
return f"{reverse('inclusion_connect:authorize')}?{urlencode(params)}"


Expand Down
4 changes: 2 additions & 2 deletions lacommunaute/utils/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ def test_inclusion_connect_url(self):
context = Context({"next_url": next_url, "anchor": anchor})

out = Template("{% load str_filters %}{% inclusion_connect_url next_url%}").render(context)
params = {"next_url": next_url}
params = {"next": next_url}
self.assertEqual(out, f"{inclusion_connect_url}?{urlencode(params)}")

out = Template("{% load str_filters %}{% inclusion_connect_url next_url anchor %}").render(context)
params = {"next_url": f"{next_url}#{anchor}"}
params = {"next": f"{next_url}#{anchor}"}
self.assertEqual(out, f"{inclusion_connect_url}?{urlencode(params)}")

def test_relativetimesince_fr(self):
Expand Down

0 comments on commit 5c88c6e

Please sign in to comment.