diff --git a/test/backends/SessionDeleteHasManyToMany.cpp b/test/backends/SessionDeleteHasManyToMany.cpp index 0910b45..808a936 100644 --- a/test/backends/SessionDeleteHasManyToMany.cpp +++ b/test/backends/SessionDeleteHasManyToMany.cpp @@ -22,23 +22,6 @@ void validate_author_state(const object_ptr& ptr, object_state expec } } -namespace matador::utils { -template < typename ValueType > -std::ostream& operator<<(std::ostream& os, const result& value) { - if (value) { - return os; - } - return os << "Error: " << value.err(); -} - -std::ostream& operator<<(std::ostream& os, const result& value) { - if (value) { - return os; - } - return os << "Error: " << value.err(); -} -} - TEST_CASE_METHOD(SessionFixture, "Test delete object with has many to many relation", "[session][delete][has_many_to_many]") { auto result = schema.attach("recipes") .and_then( [this] { return schema.attach("ingredients"); } ) @@ -77,4 +60,10 @@ TEST_CASE_METHOD(SessionFixture, "Test delete object with has many to many relat const auto ing_result = ses.find(ingredients[0]->id); REQUIRE(ing_result.is_ok()); REQUIRE(ing_result.value()->recipes.size() == 2); + + auto del_res = ses.remove(recipes[0]); + REQUIRE(del_res); + + recipe_result = ses.find(1); + REQUIRE_FALSE(recipe_result); }