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 @@ -209,29 +209,16 @@ metadata = optional(revision_metadata()) return draw( - one_of( - builds( - dict, - name=name, - message=message, - synthetic=synthetic, - author=none(), - date=none(), - target=target, - target_type=target_type, - metadata=metadata, - ), - builds( - dict, - name=name, - message=message, - synthetic=synthetic, - date=timestamps_with_timezone_d(), - author=persons_d(), - target=target, - target_type=target_type, - metadata=metadata, - ), + builds( + dict, + name=name, + message=message, + synthetic=synthetic, + date=optional(timestamps_with_timezone_d()), + author=optional(persons_d()), + target=target, + target_type=target_type, + metadata=metadata, ) ) diff --git a/swh/model/model.py b/swh/model/model.py --- a/swh/model/model.py +++ b/swh/model/model.py @@ -628,12 +628,6 @@ git_object = git_objects.release_git_object(self) return hashlib.new("sha1", git_object).digest() - @author.validator - def check_author(self, attribute, value): - """If the author is `None`, checks the date is `None` too.""" - if self.author is None and self.date is not None: - raise ValueError("release date must be None if author is None.") - def to_dict(self): rel = super().to_dict() if rel["metadata"] is None: