@@ -41,7 +41,8 @@ func createDocument(ctx context.Context, col driver.Collection, document interfa
4141
4242// TestCreateDocument creates a document and then checks that it exists.
4343func TestCreateDocument (t * testing.T ) {
44- c := createClientFromEnv (t , true )
44+ // don't use disallowUnknownFields in this test - we have here custom structs defined
45+ c := createClient (t , true , false )
4546 db := ensureDatabase (nil , c , "document_test" , nil , t )
4647 col := ensureCollection (nil , db , "document_test" , nil , t )
4748 doc := UserDoc {
@@ -70,7 +71,8 @@ func TestCreateDocument(t *testing.T) {
7071
7172// TestCreateDocumentWithKey creates a document with given key and then checks that it exists.
7273func TestCreateDocumentWithKey (t * testing.T ) {
73- c := createClientFromEnv (t , true )
74+ // don't use disallowUnknownFields in this test - we have here custom structs defined
75+ c := createClient (t , true , false )
7476 db := ensureDatabase (nil , c , "document_test" , nil , t )
7577 col := ensureCollection (nil , db , "document_withKey_test" , nil , t )
7678 doc := UserDocWithKey {
@@ -104,7 +106,8 @@ func TestCreateDocumentWithKey(t *testing.T) {
104106// TestCreateDocumentReturnNew creates a document and checks the document returned in in ReturnNew.
105107func TestCreateDocumentReturnNew (t * testing.T ) {
106108 ctx := context .Background ()
107- c := createClientFromEnv (t , true )
109+ // don't use disallowUnknownFields in this test - we have here custom structs defined
110+ c := createClient (t , true , false )
108111 db := ensureDatabase (ctx , c , "document_test" , nil , t )
109112 col := ensureCollection (ctx , db , "document_test" , nil , t )
110113 doc := UserDoc {
@@ -160,7 +163,8 @@ func TestCreateDocumentNil(t *testing.T) {
160163// TestCreateDocumentInWaitForSyncCollection creates a document in a collection with waitForSync enabled,
161164// and then checks that it exists.
162165func TestCreateDocumentInWaitForSyncCollection (t * testing.T ) {
163- c := createClientFromEnv (t , true )
166+ // don't use disallowUnknownFields in this test - we have here custom structs defined
167+ c := createClient (t , true , false )
164168 db := ensureDatabase (nil , c , "document_test" , nil , t )
165169 col := ensureCollection (nil , db , "TestCreateDocumentInWaitForSyncCollection" , & driver.CreateCollectionOptions {
166170 WaitForSync : true ,
0 commit comments