diff --git a/internal/models/models.go b/internal/models/models.go index 3533381cb589de7de8804d05258c76890fd31899..50f40e5dab13dae7dca6c52d5a256aeee8203259 100644 --- a/internal/models/models.go +++ b/internal/models/models.go @@ -45,7 +45,6 @@ func NewDataHandler() *DataHandler { db.AutoMigrate(&PartnersInfo{}) db.AutoMigrate(&Price{}) - // Create default partner status db.Create(&PartnersInfo{ GRDFFailure: false, diff --git a/internal/rootmux/rootmux_test.go b/internal/rootmux/rootmux_test.go index 6b46151c60924aa46ceee9bc9a42cec18be77068..63ba50e8a032eb54758efca018aa5edc71a0a51c 100644 --- a/internal/rootmux/rootmux_test.go +++ b/internal/rootmux/rootmux_test.go @@ -173,6 +173,11 @@ func adminTests(t *testing.T) { // Try to get the monthlyInfo created (must pass) do("GET", "/api/common/partnersInfo", xsrfHeader, "", http.StatusOK, partnersInfoStr) + // Try to update the partnersInfo (must pass) + do("PUT", "/api/admin/partnersInfo", xsrfHeader, partnersInfoStr, http.StatusOK, partnersInfoStr) + // Try to get the monthlyInfo created (must pass) + do("GET", "/api/common/partnersInfo", xsrfHeader, "", http.StatusOK, partnersInfoStr) + // Try to delete the monthlyNews created (must pass) do("DELETE", "/api/admin/monthlyNews/2021/1", xsrfHeader, "", http.StatusOK, "successful delete") // Try to get a monthlyNews after it is deleted (must fail because not found)