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/dataset model #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Tests/dataset model #2

wants to merge 4 commits into from

Conversation

nifedara
Copy link
Owner

@nifedara nifedara commented Apr 2, 2024

What does this PR do?

Adds backend test case

Consideration?

  • Although some might suggest not testing a model that doesn't have a return statement, I added a test for this as it is nice to have
  • I ensured to use Black formatter
  • I used coverage to see test coverage but didn't add that to the requirement file and factory_boy to isolate test data. So to check coverage, you will have to install coverage yourself and also install factory_boy:
    • pip install coverage and pip install factory_boy

How to test?

  • Clone this repo
  • Follow the installation guide
  • run docker exec -it api bash to run the following commands in the container:
    • coverage run --omit='*/usr/*' manage.py test tests.test_login_model
    • or just coverage run manage.py test tests.test_login_model
    • coverage report (to see a report of the test coverage)

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.

1 participant