0
0
Djangoframework~10 mins

Coverage reporting in Django - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to run tests with coverage in Django.

Django
coverage run --source='.' manage.py [1]
Drag options to blanks, or click blank then click option'
Atest
Brunserver
Cmigrate
Dshell
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'runserver' instead of 'test' will start the server, not run tests.
Using 'migrate' runs database migrations, not tests.
2fill in blank
medium

Complete the command to generate a coverage report in the terminal.

Django
coverage [1]
Drag options to blanks, or click blank then click option'
Arun
Berase
Creport
Dhtml
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' again instead of 'report' will rerun tests.
Using 'html' generates a report in a browser, not terminal.
3fill in blank
hard

Fix the error in the command to generate an HTML coverage report.

Django
coverage [1] -d coverage_html
Drag options to blanks, or click blank then click option'
Acombine
Breport
Crun
Dhtml
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'report' outputs text, not HTML files.
Using 'run' reruns tests, not generate reports.
4fill in blank
hard

Fill both blanks to create a coverage report that omits tests folder and shows missing lines.

Django
coverage report --omit=[1] --[2]
Drag options to blanks, or click blank then click option'
Atests/*
Bhtml
Cshow-missing
Dxml
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'html' or 'xml' instead of 'show-missing' will change report format.
Not omitting tests folder will include test code in coverage.
5fill in blank
hard

Fill all three blanks to run tests with coverage, generate HTML report, and erase old data.

Django
coverage [1] && coverage [2] --source='.' manage.py test && coverage [3] -d htmlcov
Drag options to blanks, or click blank then click option'
Arun
Berase
Chtml
Dreport
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' in the first blank will combine old data with new.
Skipping 'erase' may cause outdated coverage info.