Commit 21fff415 by bergquist

removes unnessecary db request

parent 935da14f
...@@ -200,8 +200,6 @@ func TestAlertRuleExtraction(t *testing.T) { ...@@ -200,8 +200,6 @@ func TestAlertRuleExtraction(t *testing.T) {
Convey("Alert notifications are in DB", func() { Convey("Alert notifications are in DB", func() {
sqlstore.InitTestDB(t) sqlstore.InitTestDB(t)
err := sqlstore.CreateOrg(&m.CreateOrgCommand{Name: "Main Org."})
So(err, ShouldBeNil)
firstNotification := m.CreateAlertNotificationCommand{Uid: "notifier1", OrgId: 1, Name: "1"} firstNotification := m.CreateAlertNotificationCommand{Uid: "notifier1", OrgId: 1, Name: "1"}
err = sqlstore.CreateAlertNotificationCommand(&firstNotification) err = sqlstore.CreateAlertNotificationCommand(&firstNotification)
So(err, ShouldBeNil) So(err, ShouldBeNil)
......
...@@ -59,10 +59,8 @@ func TestAlertRuleModel(t *testing.T) { ...@@ -59,10 +59,8 @@ func TestAlertRuleModel(t *testing.T) {
}) })
Convey("can construct alert rule model", func() { 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"} firstNotification := m.CreateAlertNotificationCommand{OrgId: 1, Name: "1"}
err = sqlstore.CreateAlertNotificationCommand(&firstNotification) err := sqlstore.CreateAlertNotificationCommand(&firstNotification)
So(err, ShouldBeNil) So(err, ShouldBeNil)
secondNotification := m.CreateAlertNotificationCommand{Uid: "notifier2", OrgId: 1, Name: "2"} secondNotification := m.CreateAlertNotificationCommand{Uid: "notifier2", OrgId: 1, Name: "2"}
err = sqlstore.CreateAlertNotificationCommand(&secondNotification) err = sqlstore.CreateAlertNotificationCommand(&secondNotification)
...@@ -182,6 +180,5 @@ func TestAlertRuleModel(t *testing.T) { ...@@ -182,6 +180,5 @@ func TestAlertRuleModel(t *testing.T) {
So(err, ShouldNotBeNil) 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") So(err.Error(), ShouldEqual, "Alert validation error: Neither id nor uid is specified, type assertion to string failed AlertId: 1 PanelId: 1 DashboardId: 1")
}) })
}) })
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment