Skip to content

Commit

Permalink
Fix unique_id_property to return the db_property if it is set
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah256 committed May 21, 2019
1 parent 788030b commit f82be78
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion estuary/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def unique_id_property(self):
"""
for _, prop_def in self.__all_properties__:
if isinstance(prop_def, UniqueIdProperty):
return prop_def.name
return prop_def.db_property or prop_def.name

@staticmethod
def inflate_results(results):
Expand Down
10 changes: 5 additions & 5 deletions tests/api/test_recents.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
def test_get_recent_nodes(client):
"""Test the get_recent_nodes function."""
id_dict = {
FreshmakerEvent.__label__: 'id_',
BugzillaBug.__label__: 'id_',
DistGitCommit.__label__: 'hash_',
KojiBuild.__label__: 'id_',
Advisory.__label__: 'id_'
FreshmakerEvent.__label__: 'id',
BugzillaBug.__label__: 'id',
DistGitCommit.__label__: 'hash',
KojiBuild.__label__: 'id',
Advisory.__label__: 'id'
}
timestamp_dict = {
FreshmakerEvent.__label__: 'id',
Expand Down
10 changes: 5 additions & 5 deletions tests/utils/test_recents.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ def test_get_recent_nodes():
assert nodes['BugzillaBug'][2]['id'] == '11111'

id_dict = {
FreshmakerEvent.__label__: 'id_',
BugzillaBug.__label__: 'id_',
DistGitCommit.__label__: 'hash_',
KojiBuild.__label__: 'id_',
Advisory.__label__: 'id_'
FreshmakerEvent.__label__: 'id',
BugzillaBug.__label__: 'id',
DistGitCommit.__label__: 'hash',
KojiBuild.__label__: 'id',
Advisory.__label__: 'id'
}
timestamp_dict = {
FreshmakerEvent.__label__: 'id',
Expand Down

0 comments on commit f82be78

Please sign in to comment.