Test exercise params form

Test form of parameters choices for foreign exercise.

Testing:
  • render form with default values;

  • render form with saved values;

  • save user params to database.

CATEGORY_CHOICES = [(0, 'Категория'), (1, 'category_u3_c1'), (2, 'category_u3_c2'), (3, 'category_u3_c3'), (4, 'category_u3_c4'), (5, 'category_u3_c5')]

Category choices to assigned in the form (list[tuple(int, str)]).

CATEGORY_INITIAL = 0

Category choice alice by default (int).

SOURCE_CHOICES = [(0, 'Источник'), (1, 'source_u3_s1'), (2, 'source_u3_s2'), (3, 'source_u3_s3'), (4, 'source_u3_s4'), (5, 'source_u3_s5')]

Source choices to assigned in the form (list[tuple(int, str)]).

SOURCE_INITIAL = 0

Source choice alice by default (int).

class ExerciseParamsTest(methodName='runTest')

Bases: TestCase

Test the page form with exercise parameters.

test_status_code_of_render_form() None

Test the status code of form render.

test_render_form_with_default_params() None

Test render the form with default values.

test_render_form_with_saved_params() None

Test render the form with saved params.

test_form_to_save_params() None

Test form to save params.