From 21fff415ed6dc405435e83c8a214926f61850af9 Mon Sep 17 00:00:00 2001 From: bergquist Date: Mon, 28 Jan 2019 15:37:52 +0100 Subject: [PATCH] removes unnessecary db request --- pkg/services/alerting/extractor_test.go | 2 -- pkg/services/alerting/rule_test.go | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/pkg/services/alerting/extractor_test.go b/pkg/services/alerting/extractor_test.go index 66adf951269..9c689fec921 100644 --- a/pkg/services/alerting/extractor_test.go +++ b/pkg/services/alerting/extractor_test.go @@ -200,8 +200,6 @@ func TestAlertRuleExtraction(t *testing.T) { Convey("Alert notifications are in DB", func() { sqlstore.InitTestDB(t) - err := sqlstore.CreateOrg(&m.CreateOrgCommand{Name: "Main Org."}) - So(err, ShouldBeNil) firstNotification := m.CreateAlertNotificationCommand{Uid: "notifier1", OrgId: 1, Name: "1"} err = sqlstore.CreateAlertNotificationCommand(&firstNotification) So(err, ShouldBeNil) diff --git a/pkg/services/alerting/rule_test.go b/pkg/services/alerting/rule_test.go index f0c7ea0c9d6..f4172a57e74 100644 --- a/pkg/services/alerting/rule_test.go +++ b/pkg/services/alerting/rule_test.go @@ -59,10 +59,8 @@ func TestAlertRuleModel(t *testing.T) { }) Convey("can construct alert rule model", func() { - err := sqlstore.CreateOrg(&m.CreateOrgCommand{Name: "Main Org."}) - So(err, ShouldBeNil) firstNotification := m.CreateAlertNotificationCommand{OrgId: 1, Name: "1"} - err = sqlstore.CreateAlertNotificationCommand(&firstNotification) + err := sqlstore.CreateAlertNotificationCommand(&firstNotification) So(err, ShouldBeNil) secondNotification := m.CreateAlertNotificationCommand{Uid: "notifier2", OrgId: 1, Name: "2"} err = sqlstore.CreateAlertNotificationCommand(&secondNotification) @@ -182,6 +180,5 @@ func TestAlertRuleModel(t *testing.T) { So(err, ShouldNotBeNil) So(err.Error(), ShouldEqual, "Alert validation error: Neither id nor uid is specified, type assertion to string failed AlertId: 1 PanelId: 1 DashboardId: 1") }) - }) }