def test_associate_already_associated(self): line = self.add_line() custom = self.add_usercustom() line_dao.associate_endpoint_custom(line, custom) line_dao.associate_endpoint_custom(line, custom) result = self.session.query(Line).first() assert_that(result, equal_to(line)) assert_that(result.endpoint_custom, equal_to(custom))
def test_linefeatures_name_updated_after_custom_endpoint_association(self): usercustom_row = self.add_usercustom() line_row = self.add_line() line = line_dao.get(line_row.id) line_dao.associate_endpoint_custom(line, usercustom_row) line_dao.edit(line) edited_linefeatures = self.session.query(Line).get(line_row.id) assert_that(edited_linefeatures.name, equal_to(usercustom_row.interface))
def test_dissociate_line_endpoint_custom(self): line = self.add_line() custom = self.add_usercustom() line_dao.associate_endpoint_custom(line, custom) line_dao.dissociate_endpoint_custom(line, custom) result = self.session.query(Line).first() assert_that(result, equal_to(line)) assert_that(result.endpoint_custom_id, none()) assert_that(result.endpoint_custom, none())