tests.management.commands package#

Submodules#

tests.management.commands.add_additional_test_data_for_clubs module#

Script to add test data for testing club admin and pre-paid

class tests.management.commands.add_additional_test_data_for_clubs.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]#

Bases: BaseCommand

handle(*args, **options)[source]#

The actual logic of the command. Subclasses must implement this method.

tests.management.commands.add_test_data module#

Script to create cobalt test data from csv files

CSV Files are processed in sort order and depend upon data that is created in earlier steps. For example, an Event needs to be created before an EventEntry.

File format is:

Row 1 - app, model [, duplicates]

app - name of Django application, e.g. events model - Django model name e.g. EventEntry duplicates - optional literal. If the word duplicates is present then they are allowed

Row 2 - headings

These map to the field names of the table.

Example:

accounts , TeamMate id.user.accounts.User, id.team_mate.accounts.User, make_payments aa , mark , 0 bb , mark , 0

class tests.management.commands.add_test_data.Command[source]#

Bases: BaseCommand

accounts_user(app, model, data)[source]#

Accounts get created first (must be first file) and we keep a reference to them for use when processing the other files

add_arguments(parser)[source]#

Entry point for subclassed commands to add custom arguments.

handle(*args, **options)[source]#

The actual logic of the command. Subclasses must implement this method.

print_error_found_and_exit(exc, exec_cmd)[source]#

This handles exceptions

process_csv(csv)[source]#

do the work on the csv data

process_csv_row(row, app, model, allow_dupes, csv, app_model_dic)[source]#

handles processing a single row of data from the CSV

tests.management.commands.add_test_data_forum_posts module#

Script to create cobalt test data

class tests.management.commands.add_test_data_forum_posts.Command[source]#

Bases: BaseCommand

add_comments(post, user_list)[source]#

add comments to a forum post

handle(*args, **options)[source]#

The actual logic of the command. Subclasses must implement this method.

random_paragraphs()[source]#

generate a random paragraph

random_paragraphs_with_stuff()[source]#

generate a more realistic rich test paragraph with headings and pics

random_sentence()[source]#

generate a random sentence

tests.management.commands.create_test_users_from_session_file module#

class tests.management.commands.create_test_users_from_session_file.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]#

Bases: BaseCommand

Reads a compscore user file and creates the users, so we can test club_sessions

add_arguments(parser)[source]#

Entry point for subclassed commands to add custom arguments.

handle(*args, **options)[source]#

The actual logic of the command. Subclasses must implement this method.

tests.management.commands.create_test_users_from_session_file.make_data(system_number, first_name, last_name, club, membership)[source]#

create user and associated records

tests.management.commands.mass_email_test module#

class tests.management.commands.mass_email_test.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]#

Bases: BaseCommand

Mass email test - creates lots of users for test sending See confluence for details on how to test

handle(*args, **options)[source]#

The actual logic of the command. Subclasses must implement this method.

tests.management.commands.reformat_test_csvs module#

Reformat test CV files so you can edit them with the content under the titles

class tests.management.commands.reformat_test_csvs.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]#

Bases: BaseCommand

handle(*args, **options)[source]#

The actual logic of the command. Subclasses must implement this method.

tests.management.commands.reformat_test_csvs.fix_file(old_file)[source]#

tests.management.commands.run_tests_integration module#

class tests.management.commands.run_tests_integration.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]#

Bases: BaseCommand

add_arguments(parser)[source]#

Entry point for subclassed commands to add custom arguments.

handle(*args, **options)[source]#

The actual logic of the command. Subclasses must implement this method.

tests.management.commands.run_tests_silent module#

class tests.management.commands.run_tests_silent.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]#

Bases: BaseCommand

handle(*args, **options)[source]#

The actual logic of the command. Subclasses must implement this method.

tests.management.commands.run_tests_unit module#

class tests.management.commands.run_tests_unit.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]#

Bases: BaseCommand

add_arguments(parser)[source]#

Entry point for subclassed commands to add custom arguments.

handle(*args, **options)[source]#

The actual logic of the command. Subclasses must implement this method.

tests.management.commands.sanitise_production_data_for_testing module#

Script to sanitise prod data so we can use it for testing

class tests.management.commands.sanitise_production_data_for_testing.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]#

Bases: BaseCommand

handle(*args, **options)[source]#

The actual logic of the command. Subclasses must implement this method.

Module contents#