Skip to content

Commit

Permalink
Fix ACL tests to work with Dgraph 1.2.0
Browse files Browse the repository at this point in the history
mangalaman93 committed Jan 29, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent e8b9d95 commit 0d7ba0e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions acl_test.go
Original file line number Diff line number Diff line change
@@ -111,10 +111,12 @@ func query(t *testing.T, dg *dgo.Dgraph, shouldFail bool) {
}
`

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

0 comments on commit 0d7ba0e

Please sign in to comment.