Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vrigal committed Oct 18, 2024
1 parent 2053dd0 commit fe2cd09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def build_issue(path, revisions=[]):
path=path,
level=LEVEL_ERROR,
analyzer="analyzer",
defaults={"hash": uuid.uuid4()},
defaults={"hash": uuid.uuid4().hex},
)
for rev in revisions:
issue.issue_links.create(revision=rev)
Expand Down
8 changes: 4 additions & 4 deletions backend/code_review_backend/issues/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def test_create_revision(self):
"""
Check we can create a revision through the API
"""
last_rev_id = Revision.objects.latest("id").id
self.revision.delete()
data = {
"phabricator_id": 123,
Expand All @@ -65,11 +64,12 @@ def test_create_revision(self):
self.assertEqual(response.status_code, status.HTTP_201_CREATED)

# Check a revision has been created
revision_id = Revision.objects.latest("created").id
expected_response = {
"id": last_rev_id + 1,
"id": revision_id,
"bugzilla_id": 123456,
"diffs_url": "http://testserver/v1/revision/2/diffs/",
"issues_bulk_url": "http://testserver/v1/revision/2/issues/",
"diffs_url": f"http://testserver/v1/revision/{revision_id}/diffs/",
"issues_bulk_url": f"http://testserver/v1/revision/{revision_id}/issues/",
"phabricator_url": "https://phabricator.services.mozilla.com/D123",
"phabricator_id": 123,
"phabricator_phid": "PHID-REV-xxx",
Expand Down

0 comments on commit fe2cd09

Please sign in to comment.