Skip to content

Commit

Permalink
Add get_admin_change_url to alias category model
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Nov 12, 2023
1 parent 7907064 commit 04909a1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion djangocms_alias/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __str__(self):
# Be sure to be able to see the category name even if it's not in the current language
return self.safe_translation_getter("name", any_language=True)

def get_edit_url(self):
def get_admin_change_url(self):
"""Builds the url to the admin category change view"""
return admin_reverse(CHANGE_CATEGORY_URL_NAME, args=[self.pk])

Expand Down
4 changes: 2 additions & 2 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def test_delete(self):
alias.save() # Django 4.1+ disallows to use relations (cmsplugins) of unsaved objects.
self.assertEqual(alias.cms_plugins.count(), 0)

def test_category_get_edit_url(self):
def test_category_get_admin_change_url(self):
"""
Category uses the admin change view as its absolute url
"""
Expand All @@ -420,7 +420,7 @@ def test_category_get_edit_url(self):
f"admin:{app_label}_category_change", args=[category.pk]
)

self.assertEqual(category.get_edit_url(), expected)
self.assertEqual(category.get_admin_change_url(), expected)

def test_category_name_same_across_languages(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_wizards.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,5 @@ def test_create_alias_category_wizard_form(self):
category = form.save()

with self.login_user_context(self.superuser):
response = self.client.get(category.get_edit_url())
response = self.client.get(category.get_admin_change_url())
self.assertContains(response, data['name'])

0 comments on commit 04909a1

Please sign in to comment.