Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
japsu committed Aug 12, 2024
1 parent d3d3d80 commit aa38f57
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions backend/edegal/models/album.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,11 +566,7 @@ def resolve_upstream_redirects(cls, path, **extra_criteria):
else:
# External redirect – can't resolve further
return cls.fake_album_as_dict(path=path, redirect_url=redirect_url)
elif album.path == original_path:
# path refers to an album
rewritten_parts.append(album.slug)
else:
# path refers to a picture or a technical view
rewritten_parts.append(part)

if rewrites_done:
Expand Down
4 changes: 2 additions & 2 deletions backend/edegal/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def test_resolve_redirects(self):

album_dict = Album.resolve_upstream_redirects("/album-3/child-album")
assert album_dict is not None
self.assertEqual(album_dict["path"], "/album-4/child-album")
self.assertEqual(album_dict["redirect_url"], "/album-4/child-album")

album_dict = Album.resolve_upstream_redirects("/album-3/child-album/picture")
assert album_dict is not None
self.assertEqual(album_dict["path"], "/album-4/child-album/picture")
self.assertEqual(album_dict["redirect_url"], "/album-4/child-album/picture")

0 comments on commit aa38f57

Please sign in to comment.