bug_hub.tests.models package

bug_hub.tests.models Submodules

bug_hub.tests.models.test_bug_model module

This module contains unit tests for validating the bug report model of the Bug Hub application.

class bug_hub.tests.models.test_bug_model.BugModelTestCase(methodName='runTest')[source]

Bases: TestCase

Test case for the Bug model.

setUp()[source]

Create a sample bug instance for testing

test_bug_creation()[source]

Test if a bug instance can be created correctly.

test_bug_description_length()[source]

Verify that a Bug instance can be saved with a very long ‘description.’

test_bug_listing()[source]

Verify that a list of Bug instances can be retrieved, and it contains the expected bugs.

test_bug_ordering()[source]

Verify that Bug instances are correctly ordered by ‘report_date.’

test_bug_report_date_auto_generated()[source]

Test if the report_date field is auto-generated.

test_bug_str_representation()[source]

Test the string representation of a bug instance.

test_bug_title_max_length()[source]

Verify that a Bug instance cannot be saved with a very long ‘title.’

test_bug_title_min_length()[source]

Verify that a Bug instance cannot be saved with a very short ‘title.’

test_bug_title_unique()[source]

Test that bug titles’ uniqueness constraint is enforced.

test_bug_type_choices()[source]

Ensure that only valid choices for ‘bug_type’ are allowed when creating a Bug instance.

test_status_choices()[source]

Ensure that only valid choices for ‘status’ are allowed when creating a Bug instance.