Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests of products api filters and sorting #94

Merged
merged 4 commits into from
Apr 9, 2024

Conversation

yanazPL
Copy link
Contributor

@yanazPL yanazPL commented Mar 26, 2024

Fixed small bug in availability filtter.

Made products fixture return list - for ease of testing.

In this fixture created_at has been ignored (can't change auto_now_add field)
created_at = models.DateTimeField(auto_now_add=True)

Now tests make use of default created_at

Added two small fixtures.

I have created testes for every filter and ordering.

@yanazPL yanazPL requested a review from a team March 26, 2024 13:38
Copy link
Contributor

@jacoor jacoor left a comment

Choose a reason for hiding this comment

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

Looks good, however those copy and paste things has to be removed.

print(response.data)
assert response.status_code == 200
assert response.data["count"] == 10
for value, prod in enumerate(products_data, start=1):
Copy link
Contributor

Choose a reason for hiding this comment

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

What about 0 record?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

record 0 is there, but it's price is 1

@yanazPL yanazPL merged commit f5d1a83 into dev Apr 9, 2024
2 checks passed
@yanazPL yanazPL deleted the feature/api-filters-sorting branch April 9, 2024 12:20
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.

2 participants