Example #1
0
func TestDatastoreKeyChangingIDInvalidatesCache(t *testing.T) {

	people := CreateTestModel()
	person := people.New()

	var key *datastore.Key = person.DatastoreKey()

	person.setID(123)

	var keyAfterID *datastore.Key = person.DatastoreKey()

	if key.Eq(keyAfterID) {
		t.Errorf("Key cache should be invalidated after setID is called")
	}

}