def test_generic_with_key_match(self): result = policy._check_generic(None, "tenant", "%(tenant_id)s", dict(tenant_id="spam"), dict(tenant="spam")) self.assertEqual(result, True)
def test_generic_no_key(self): result = policy._check_generic(None, "tenant", "%(tenant_id)s", dict(tenant_id="spam"), {}) self.assertEqual(result, False)
def test_generic_boolean(self): result = policy._check_generic(None, "is_admin", "True", {}, dict(is_admin=True)) self.assertEqual(result, True)