Bird
0
0

You want a detailed HTML report of your Django test coverage. Which sequence of commands should you run?

hard📝 state output Q15 of 15
Django - Testing Django Applications
You want a detailed HTML report of your Django test coverage. Which sequence of commands should you run?
Acoverage report && coverage run manage.py test
Bcoverage run manage.py test && coverage html
Ccoverage html && coverage run manage.py test
Dmanage.py test coverage run && coverage report
Step-by-Step Solution
Solution:
  1. Step 1: Run tests with coverage collection

    Use 'coverage run manage.py test' to collect coverage data while running tests.
  2. Step 2: Generate HTML report

    Run 'coverage html' after tests to create a detailed HTML coverage report.
  3. Step 3: Verify command order

    coverage run manage.py test && coverage html correctly chains these commands; others have wrong order or commands.
  4. Final Answer:

    coverage run manage.py test && coverage html -> Option B
  5. Quick Check:

    Run tests then html report = D [OK]
Quick Trick: Run tests first, then 'coverage html' for report [OK]
Common Mistakes:
MISTAKES
  • Running 'coverage html' before tests
  • Mixing command order
  • Using 'manage.py test coverage run' which is invalid

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes