Esempio n. 1
0
func setUP() nerdz.OAuth2AccessData {
	var at nerdz.OAuth2AccessData
	nerdz.Db().First(&at, uint64(1))

	// since we got db access, we update the created_at field and make the request again
	at.CreatedAt = time.Now()
	if err := nerdz.Db().Updates(&at); err != nil {
		panic(err.Error())
	}
	return at
}
Esempio n. 2
0
func cleanUP() {
	var at nerdz.OAuth2AccessData
	nerdz.Db().First(&at, uint64(1))

	// since we got db access, we update the created_at field and make the request again
	at.CreatedAt = time.Now()
	// Make the access token expire again to make next tests
	at.CreatedAt = time.Date(2010, 1, 1, 1, 1, 1, 1, time.UTC)
	if err := nerdz.Db().Updates(&at); err != nil {
		panic(err.Error())
	}
}