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")