Skip to content

Commit 0d7ba0e

Browse files
committed
Fix ACL tests to work with Dgraph 1.2.0
1 parent e8b9d95 commit 0d7ba0e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

acl_test.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,12 @@ func query(t *testing.T, dg *dgo.Dgraph, shouldFail bool) {
111111
}
112112
`
113113

114-
_, err := dg.NewReadOnlyTxn().Query(context.Background(), q)
115-
if (err != nil && !shouldFail) || (err == nil && shouldFail) {
116-
t.Logf("result did not match for query")
117-
t.FailNow()
114+
// Dgraph does not throw Permission Denied error in query any more. Dgraph
115+
// just does not return the predicates that a user doesn't have access to.
116+
resp, err := dg.NewReadOnlyTxn().Query(context.Background(), q)
117+
require.NoError(t, err)
118+
if shouldFail {
119+
require.Equal(t, string(resp.Json), "{}")
118120
}
119121
}
120122

0 commit comments

Comments
 (0)