diff --git a/swh/web/browse/snapshot_context.py b/swh/web/browse/snapshot_context.py --- a/swh/web/browse/snapshot_context.py +++ b/swh/web/browse/snapshot_context.py @@ -14,15 +14,8 @@ from django.template.defaultfilters import filesizeformat from django.utils.html import escape -from swh.model.identifiers import ( - CONTENT, - DIRECTORY, - RELEASE, - REVISION, - SNAPSHOT, - snapshot_identifier, - swhid, -) +from swh.model.identifiers import CONTENT, DIRECTORY, RELEASE, REVISION, SNAPSHOT, swhid +from swh.model.model import Snapshot from swh.web.browse.utils import ( content_display_max_size, format_log_entries, @@ -59,7 +52,7 @@ ) from swh.web.config import get_config -_empty_snapshot_id = snapshot_identifier({"branches": {}}) +_empty_snapshot_id = Snapshot(branches={}).id.hex() def _get_branch(branches, branch_name, snapshot_id): diff --git a/swh/web/tests/strategies.py b/swh/web/tests/strategies.py --- a/swh/web/tests/strategies.py +++ b/swh/web/tests/strategies.py @@ -23,9 +23,9 @@ from swh.model.hashutil import DEFAULT_ALGORITHMS, hash_to_bytes, hash_to_hex from swh.model.hypothesis_strategies import origins as new_origin_strategy from swh.model.hypothesis_strategies import snapshots as new_snapshot -from swh.model.identifiers import directory_identifier from swh.model.model import ( Content, + Directory, Person, Revision, RevisionType, @@ -245,7 +245,7 @@ Hypothesis strategy returning the empty directory ingested into the test archive. """ - return just(directory_identifier({"entries": []})) + return just(Directory(entries=()).id.hex()) def unknown_directory():