Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults kwarg body Expr Str With Call NameLoad Str Call NameLoad NameStore body Expr Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Num Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults vararg body Expr Str Expr Call AttributeLoad NameLoad attr Call NameLoad ListComp AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Str Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Str Str Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str With Call NameLoad Str Dict Str ListLoad Str body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad NameLoad attr NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad NameLoad attr NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str With Call NameLoad Str Dict Str ListLoad Str body Assign NameStore Call AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad NameLoad attr NameLoad Str decorator_list decorator_list
N/A N/A 
Tests for management command to create default roles.

 cStringIO StringIO django.core.management call_command mock patch tests case CreateDefaultRolesTest N/A N/A case DBTestCase N/A N/A Tests for create_default_roles management command. call_command N/A N/A self N/A kwargs N/A N/A Runs the management command under test and returns stdout output. N/A N/A patch sys.stdout N/A StringIO stdout N/A N/A N/A call_command create_default_roles kwargs N/A N/A N/A stdout seek 0 N/A N/A N/A stdout read N/A assertRoles N/A N/A self N/A groups N/A N/A Assert that the given set of group names, and only those, exist. N/A N/A N/A self assertEqual N/A set N/A N/A g name N/A g N/A N/A N/A N/A N/A self model Role objects all N/A set groups N/A test_creates_roles N/A N/A self N/A N/A N/A Command creates expected roles. N/A N/A N/A self call_command N/A N/A N/A self assertRoles Tester Test Creator Test Manager Admin N/A test_skips_existing_roles N/A N/A self N/A N/A N/A Command skips roles that already exist. N/A N/A N/A N/A N/A N/A self model Role objects create name Tester N/A output N/A N/A self call_command N/A N/A N/A self assertIn Role 'Tester' already exists; skipping. output N/A N/A N/A self assertRoles Tester Test Creator Test Manager Admin N/A test_unknown_permission N/A N/A self N/A N/A N/A Gracefully skips unknown permission. N/A N/A patch moztrap.model.core.management.commands.create_default_roles.ROLES N/A Foo N/A foo.foo N/A N/A output N/A N/A self call_command N/A N/A N/A self assertIn Permission 'foo.foo' unknown; skipping. output N/A N/A N/A self assertRoles Foo N/A test_normal_output N/A N/A self N/A N/A N/A Test output when all roles are created. N/A output N/A N/A self call_command N/A expected Role 'Test Creator' created.
  Permission 'library.create_cases' added.
  Permission 'library.manage_suite_cases' added.
  Permission 'execution.execute' added.
Role 'Admin' created.
  Permission 'core.manage_users' added.
  Permission 'core.manage_products' added.
  Permission 'library.manage_cases' added.
  Permission 'library.manage_suites' added.
  Permission 'tags.manage_tags' added.
  Permission 'execution.manage_runs' added.
  Permission 'execution.review_results' added.
  Permission 'environments.manage_environments' added.
  Permission 'library.create_cases' added.
  Permission 'library.manage_suite_cases' added.
  Permission 'execution.execute' added.
Role 'Test Manager' created.
  Permission 'core.manage_products' added.
  Permission 'library.manage_cases' added.
  Permission 'library.manage_suites' added.
  Permission 'tags.manage_tags' added.
  Permission 'execution.manage_runs' added.
  Permission 'execution.review_results' added.
  Permission 'environments.manage_environments' added.
  Permission 'library.create_cases' added.
  Permission 'library.manage_suite_cases' added.
  Permission 'execution.execute' added.
Role 'Tester' created.
  Permission 'execution.execute' added.
 N/A N/A N/A self assertEqual output expected N/A test_creates_all_quietly N/A N/A self N/A N/A N/A Test output when verbosity=0. N/A output N/A N/A self call_command verbosity 0 N/A N/A N/A self assertEqual output N/A test_skips_existing_roles_quietly N/A N/A self N/A N/A N/A Command skips roles with no output when verbosity 0. N/A N/A N/A N/A N/A N/A self model Role objects create name Tester N/A output N/A N/A self call_command verbosity 0 N/A N/A N/A self assertEqual output N/A test_skips_unknown_permission_quietly N/A N/A self N/A N/A N/A Skips unknown permission silently with verbosity 0. N/A N/A patch moztrap.model.core.management.commands.create_default_roles.ROLES N/A Foo N/A foo.foo N/A N/A output N/A N/A self call_command verbosity 0 N/A N/A N/A self assertEqual output N/A N/A