Skip to content

Tests/feedbackAoi-model#8

Open
nifedara wants to merge 16 commits intomasterfrom
tests/feedbackAoi-model
Open

Tests/feedbackAoi-model#8
nifedara wants to merge 16 commits intomasterfrom
tests/feedbackAoi-model

Conversation

@nifedara
Copy link
Copy Markdown
Owner

@nifedara nifedara commented Apr 2, 2024

What does this PR do?

Adds backend test case

Consideration?

  • In the Factory file(factories.py), I didn't include the fields that are null to simplify the data factory
  • I also didn't add the date fields as they will be created automatically
  • Although some might suggest not testing a model that doesn't have a return statement, I added tests for it as it is nice to have
  • I used Black formatter
  • I didn't add coverage and factory_boy to the requirement file. So to check coverage and to use factory_boy, you have to install them yourself:
    • 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_core_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