added belongs to and has one tests
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#include "catch2/catch_test_macros.hpp"
|
||||
|
||||
#include "SessionFixture.hpp"
|
||||
|
||||
#include "connection.hpp"
|
||||
|
||||
#include "matador/query/session.hpp"
|
||||
|
||||
#include "models/user.hpp"
|
||||
|
||||
using namespace matador::test;
|
||||
using namespace matador::query;
|
||||
using namespace matador::object;
|
||||
|
||||
TEST_CASE_METHOD(SessionFixture, "Test insert object with has_one relation", "[session][insert][has_one]") {
|
||||
session sess{conn};
|
||||
user_pk_generator u;
|
||||
u.name = "John Doe";
|
||||
sess.persist(u);
|
||||
|
||||
REQUIRE(u.id > 0);
|
||||
}
|
||||
Reference in New Issue
Block a user