def test_10_delete_resolver_realm(self): resolvername = "res1" realmname = "r1" # create a resolver r = Resolver(resolvername, "passwdresolver") _rid = r.save() # create a realm with this resolver realm = Realm(realmname) _realm_id = realm.save() rr = ResolverRealm(realm_name=realmname, resolver_name=resolvername) rr_id = rr.save() self.assertTrue(rr_id > 0, rr_id) # check how many resolvers are in the realm db_realm = Realm.query.filter_by(name=realmname).first() self.assertTrue(len(db_realm.resolver_list) == 1, len(db_realm.resolver_list)) # remove the resolver from the realm # we can do this by deleting rr_id rr.delete() # check how many resolvers are in the realm self.assertTrue(len(db_realm.resolver_list) == 0, len(db_realm.resolver_list)) # delete the realm db_realm.delete()