Пример #1
0
def createuser(
    context: BaseComposeContext,
    superuser: str,
    staff: bool,
    password: str,
    name: str,
    email: str,
) -> None:
    config = tutor_config.load(context.root)
    runner = context.job_runner(config)
    command = jobs.create_user_command(superuser, staff, name, email, password=password)
    runner.run_job("lms", command)
Пример #2
0
 def test_create_user_command_with_staff_with_password(self) -> None:
     command = jobs.create_user_command("superuser", True, "username",
                                        "email", "command")
     self.assertIn("set_password", command)
Пример #3
0
 def test_create_user_command_with_staff(self) -> None:
     command = jobs.create_user_command("superuser", True, "username",
                                        "email")
     self.assertIn("--staff", command)