Skip to content

tests for update and create - #49

Closed
puneeth-chanda wants to merge 3 commits into
aboutcode-org:developfrom
puneeth-chanda:dev1
Closed

tests for update and create#49
puneeth-chanda wants to merge 3 commits into
aboutcode-org:developfrom
puneeth-chanda:dev1

Conversation

@puneeth-chanda

Copy link
Copy Markdown

No description provided.

"""
for data in extract_data:
vulnerability = Vulnerability.objects.create(
vulnerability = Vulnerability.objects.update_or_create(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think update_or_create returns more than one thing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is why this test is failing.

VulnerabilityReference.objects.create(
vulnerability=vulnerability,
reference_id=data.get('vulnerability_id', ''),
reference_id=data.get('vulnerability_id', '')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should check if the object was created at the last stage or not.

summary='Multiple stack-based buffer overflows in mimetex.cgi in mimeTeX'))

self.assertTrue(Vulnerability.objects.get(
self.assertFalse(Vulnerability.objects.get(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not be changing the full meaning of the test.

@pombredanne

Copy link
Copy Markdown
Member

@singh1114 @puneeth2001 is this PR still alive?

@pombredanne

Copy link
Copy Markdown
Member

@puneeth2001 Thank you for your efforts... since you did not reply, I am closing this for now. Please reopen as needed if you want to complete this.

pombredanne added a commit that referenced this pull request Apr 2, 2025
Disable Python 3.10 tests on macOS 10.14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants