(t *testing.T)
| 256 | } |
| 257 | |
| 258 | func TestUniqueOneMutattionsTwoHardCodedUIDsDiffValue(t *testing.T) { |
| 259 | dg := setUpDgraph(t) |
| 260 | require.NoError(t, dg.SetupSchema(`email: string @unique @index(exact) .`)) |
| 261 | |
| 262 | rdf := `<0x5> <email> "example@email.com" . |
| 263 | <0x6> <email> "example@email.com" . ` |
| 264 | _, err := dg.Mutate(&api.Mutation{ |
| 265 | SetNquads: []byte(rdf), |
| 266 | CommitNow: true, |
| 267 | }) |
| 268 | require.Error(t, err) |
| 269 | require.ErrorContains(t, err, "could not insert duplicate value [example@email.com] for predicate [email]") |
| 270 | |
| 271 | resp, err := dg.Query(emailQuery) |
| 272 | require.NoError(t, err) |
| 273 | require.NoError(t, dgraphapi.CompareJSON(`{ "q": [ ]}`, string(resp.Json))) |
| 274 | } |
| 275 | |
| 276 | func TestUniqueUpsertMutation(t *testing.T) { |
| 277 | dg := setUpDgraph(t) |
nothing calls this directly
no test coverage detected