Update Mailgun test to validate delivery time format with timezone offset

- Modified the test for scheduled email delivery to assert that the delivery time includes a timezone offset in the RFC1123Z format.
- Replaced the previous check for "GMT" with a regex assertion to ensure compliance with the expected format.
This commit is contained in:
Max 2025-09-26 18:44:11 +08:00
parent ae8efd247a
commit fecbc87ba8

View file

@ -436,7 +436,8 @@ func TestSend_WithScheduledTime(t *testing.T) {
// Verify scheduled time is set
deliveryTime := r.FormValue("o:deliverytime")
assert.NotEmpty(t, deliveryTime)
assert.Contains(t, deliveryTime, "GMT") // RFC1123Z format includes GMT
// RFC1123Z format includes timezone offset (e.g., "+0000", "+0800")
assert.Regexp(t, `[+-]\d{4}`, deliveryTime)
w.WriteHeader(http.StatusOK)
json.NewEncoder(w).Encode(map[string]interface{}{"message": "Queued"})