19 lines
320 B
Go
19 lines
320 B
Go
package tdb
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestNotNullConstraint(t *testing.T) {
|
|
setupTestDb()
|
|
defer cleanupTestDb()
|
|
|
|
id, err := tdb.TEST_OwnedBy.Create(&TEST_OwnedBy{})
|
|
|
|
if assertNotNilEnd(t, err, "Expected constraint error") {
|
|
return
|
|
}
|
|
|
|
assertEqual(t, id, uint64(0), "Expected 0 (zero value) for inserted id")
|
|
}
|