Skip to content

Commit

Permalink
Merge pull request #797 from kids-first/fix-file-event-tests
Browse files Browse the repository at this point in the history
🐛 File event tests should be deterministic
  • Loading branch information
znatty22 authored Nov 2, 2021
2 parents 9045543 + f92db64 commit e809638
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/events/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_file_updated_event(db, clients, upload_file):
content_type="application/json",
data={"query": UPDATE_FILE, "variables": variables},
)
user = User.objects.first()
user = User.objects.filter(groups__name="Administrators").first()
assert Event.objects.count() == 4
assert Event.objects.filter(event_type="SF_UPD").count() == 1
assert Event.objects.filter(event_type="SF_UPD").first().user == user
Expand All @@ -117,7 +117,7 @@ def test_file_deleted_event(db, clients, upload_file):
content_type="application/json",
data={"query": DELETE_FILE, "variables": variables},
)
user = User.objects.first()
user = User.objects.filter(groups__name="Administrators").first()
assert Event.objects.count() == 4
assert Event.objects.filter(event_type="SF_DEL").count() == 1
assert Event.objects.filter(event_type="SF_DEL").first().user == user
Expand Down

0 comments on commit e809638

Please sign in to comment.