diff --git a/swh/model/hypothesis_strategies.py b/swh/model/hypothesis_strategies.py --- a/swh/model/hypothesis_strategies.py +++ b/swh/model/hypothesis_strategies.py @@ -78,7 +78,7 @@ return builds( OriginVisit, visit=integers(0, 1000), - origin=origins(), + origin=urls(), status=sampled_from(['ongoing', 'full', 'partial']), type=pgsql_text()) diff --git a/swh/model/model.py b/swh/model/model.py --- a/swh/model/model.py +++ b/swh/model/model.py @@ -102,7 +102,7 @@ class OriginVisit(BaseModel): """Represents a visit of an origin at a given point in time, by a SWH loader.""" - origin = attr.ib(type=Origin) + origin = attr.ib(type=str) date = attr.ib(type=datetime.datetime) status = attr.ib( type=str, @@ -130,7 +130,6 @@ d = d.copy() date = d.pop('date') return cls( - origin=Origin.from_dict(d.pop('origin')), date=(date if isinstance(date, datetime.datetime) else dateutil.parser.parse(date)),