Skip to content

Commit

Permalink
Merge pull request #477 from RockefellerArchiveCenter/issue-460
Browse files Browse the repository at this point in the history
Improves unit tests for Rights views and model methods
  • Loading branch information
helrond authored Jul 13, 2021
2 parents e6035a5 + ef98846 commit e50f42e
Show file tree
Hide file tree
Showing 14 changed files with 421 additions and 667 deletions.
4 changes: 2 additions & 2 deletions aurora/bag_transfer/accession/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ def rights_statement_notes(self, rights_statements):
"""Combines notes from rights statements associated with transfers in an accession."""
notes = {}
for statement in rights_statements:
rights_info = statement.get_rights_info_object()
rights_granted = statement.get_rights_granted_objects()
rights_info = statement.rights_info
rights_granted = statement.rights_granted.all()
if not statement.rights_basis.lower() in notes:
notes[statement.rights_basis.lower()] = []
notes[statement.rights_basis.lower()].append(
Expand Down
8 changes: 2 additions & 6 deletions aurora/bag_transfer/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,13 @@ class Meta:


class RightsStatementSerializer(serializers.ModelSerializer):
rights_granted = RightsStatementRightsGrantedSerializer(
source="rightsstatementrightsgranted_set", many=True
)
rights_granted = RightsStatementRightsGrantedSerializer(many=True)
rights_basis = serializers.StringRelatedField()
start_date = serializers.SerializerMethodField()
end_date = serializers.SerializerMethodField()
note = serializers.SerializerMethodField()
jurisdiction = serializers.SerializerMethodField(allow_null=True, required=False)
determination_date = serializers.SerializerMethodField(
allow_null=True, required=False
)
determination_date = serializers.SerializerMethodField(allow_null=True, required=False)
status = serializers.SerializerMethodField(allow_null=True, required=False)
terms = serializers.SerializerMethodField(allow_null=True, required=False)
citation = serializers.SerializerMethodField(allow_null=True, required=False)
Expand Down
Loading

0 comments on commit e50f42e

Please sign in to comment.