Skip to content

Commit f951543

Browse files
Validate that campaign config must have at least 1 iteration.
1 parent 847ac41 commit f951543

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tests/unit/model/test_rules.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,20 @@
55
from tests.fixtures.builders.model.rule import IterationFactory, RawCampaignConfigFactory
66

77

8-
def test_start_date_must_be_before_end_date(faker: Faker):
8+
def test_campaign_must_have_at_least_one_iteration():
9+
# Given
10+
11+
# When, Then
12+
with pytest.raises(
13+
ValueError,
14+
match=r"1 validation error for CampaignConfig\n"
15+
r"iterations\n"
16+
r".*List should have at least 1 item",
17+
):
18+
RawCampaignConfigFactory.build(iterations=[])
19+
20+
21+
def test_campaign_start_date_must_be_before_end_date(faker: Faker):
922
# Given
1023
start_date = faker.date_object()
1124
end_date = start_date - relativedelta(days=1)

0 commit comments

Comments
 (0)