def test_no_tenant_like_schemas_allowed(self):
     command = WhoWillCommand()
     command.scope = "static"
     with self.assertRaises(CommandError) as ctx:
         management.call_command(command, tenant_schemas=True, verbosity=0)
     self.assertEqual(str(ctx.exception), "Including tenant-like schemas is NOT allowed")
     command = WhoWillCommand()
     command.allow_wildcards = False
     with self.assertRaises(CommandError) as ctx:
         management.call_command(command, tenant_schemas=True, verbosity=0)
     self.assertEqual(str(ctx.exception), "Including tenant-like schemas is NOT allowed")
 def test_no_all_schemas_allowed(self):
     command = WhoWillCommand()
     command.scope = "unknown-scope"
     with self.assertRaises(CommandError) as ctx:
         management.call_command(command, all_schemas=True, verbosity=0)
     self.assertEqual(str(ctx.exception), "Including all schemas is NOT allowed")
     command = WhoWillCommand()
     command.allow_wildcards = False
     with self.assertRaises(CommandError) as ctx:
         management.call_command(command, all_schemas=True, verbosity=0)
     self.assertEqual(str(ctx.exception), "Including all schemas is NOT allowed")
 def test_specific_schemas(self):
     command = WhoWillCommand()
     command.specific_schemas = ["blog"]
     with self.assertRaises(CommandError) as ctx:
         management.call_command(command, schemas=["www"], verbosity=0)
     self.assertEqual(str(ctx.exception),
                      "This command can only run in ['blog']")
 def test_no_schema_provided(self):
     command = WhoWillCommand()
     with self.assertRaises(CommandError) as ctx:
         management.call_command(command, interactive=False, verbosity=0)
     self.assertEqual(str(ctx.exception), "No schema provided")