mirror of https://github.com/gophish/gophish
Minor cleanup for campaign results
parent
81da804761
commit
d6cbc1a936
|
@ -34,12 +34,11 @@ type Campaign struct {
|
||||||
|
|
||||||
// CampaignResults is a struct representing the results from a campaign
|
// CampaignResults is a struct representing the results from a campaign
|
||||||
type CampaignResults struct {
|
type CampaignResults struct {
|
||||||
Id int64 `json:"id"`
|
Id int64 `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
Reported string `json:"reported"`
|
Results []Result `json:"results, omitempty"`
|
||||||
Results []Result `json:"results, omitempty"`
|
Events []Event `json:"timeline,omitempty"`
|
||||||
Events []Event `json:"timeline,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CampaignSummaries is a struct representing the overview of campaigns
|
// CampaignSummaries is a struct representing the overview of campaigns
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package models
|
package models
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"net/mail"
|
"net/mail"
|
||||||
"regexp"
|
"regexp"
|
||||||
"time"
|
"time"
|
||||||
|
@ -69,10 +68,8 @@ func (s *ModelsSuite) TestResultVariableStatus(ch *check.C) {
|
||||||
// emails to be sent immediately, while others will be scheduled
|
// emails to be sent immediately, while others will be scheduled
|
||||||
for _, r := range c.Results {
|
for _, r := range c.Results {
|
||||||
if r.SendDate.Before(c.CreatedDate) || r.SendDate.Equal(c.CreatedDate) {
|
if r.SendDate.Before(c.CreatedDate) || r.SendDate.Equal(c.CreatedDate) {
|
||||||
fmt.Println("SENDING")
|
|
||||||
ch.Assert(r.Status, check.Equals, STATUS_SENDING)
|
ch.Assert(r.Status, check.Equals, STATUS_SENDING)
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("SCHEDULED")
|
|
||||||
ch.Assert(r.Status, check.Equals, STATUS_SCHEDULED)
|
ch.Assert(r.Status, check.Equals, STATUS_SCHEDULED)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue