Skip to content
This repository was archived by the owner on Sep 5, 2019. It is now read-only.

Commit 4e2b3cc

Browse files
author
Denis Krienbühl
committed
Fixes tests
1 parent 1b80a32 commit 4e2b3cc

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

onegov/org/tests/test_models.py

+23-23
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,17 @@ def delete(images):
127127

128128
# catches all intervals
129129
images = [collection.add('x.png', create_image()) for r in range(0, 11)]
130-
images[0].modified = datetime(2008, 9, 1, 16, 0, tzinfo=utc) # next month
131-
images[1].modified = datetime(2008, 8, 3, 16, 0, tzinfo=utc) # this month
132-
images[2].modified = datetime(2008, 8, 2, 16, 0, tzinfo=utc) # this month
133-
images[3].modified = datetime(2008, 8, 1, 0, 0, tzinfo=utc) # this month
134-
images[4].modified = datetime(2008, 7, 1, 16, 0, tzinfo=utc) # last month
135-
images[5].modified = datetime(2008, 5, 1, 16, 0, tzinfo=utc) # this year
136-
images[6].modified = datetime(2008, 2, 4, 12, 0, tzinfo=utc) # this year
137-
images[7].modified = datetime(2007, 12, 1, 16, 0, tzinfo=utc) # last year
138-
images[8].modified = datetime(2007, 10, 2, 14, 0, tzinfo=utc) # last year
139-
images[9].modified = datetime(2005, 4, 1, 16, 0, tzinfo=utc) # older
140-
images[10].modified = datetime(2002, 6, 4, 16, 0, tzinfo=utc) # older
130+
images[0].created = datetime(2008, 9, 1, 16, 0, tzinfo=utc) # next month
131+
images[1].created = datetime(2008, 8, 3, 16, 0, tzinfo=utc) # this month
132+
images[2].created = datetime(2008, 8, 2, 16, 0, tzinfo=utc) # this month
133+
images[3].created = datetime(2008, 8, 1, 0, 0, tzinfo=utc) # this month
134+
images[4].created = datetime(2008, 7, 1, 16, 0, tzinfo=utc) # last month
135+
images[5].created = datetime(2008, 5, 1, 16, 0, tzinfo=utc) # this year
136+
images[6].created = datetime(2008, 2, 4, 12, 0, tzinfo=utc) # this year
137+
images[7].created = datetime(2007, 12, 1, 16, 0, tzinfo=utc) # last year
138+
images[8].created = datetime(2007, 10, 2, 14, 0, tzinfo=utc) # last year
139+
images[9].created = datetime(2005, 4, 1, 16, 0, tzinfo=utc) # older
140+
images[10].created = datetime(2002, 6, 4, 16, 0, tzinfo=utc) # older
141141

142142
grouped = grouped_by_date(datetime(2008, 8, 8))
143143

@@ -151,9 +151,9 @@ def delete(images):
151151

152152
# only catch some intervals
153153
images = [collection.add('x.png', create_image()) for r in range(0, 3)]
154-
images[0].modified = datetime(2008, 8, 3, 16, 0, tzinfo=utc) # this month
155-
images[1].modified = datetime(2008, 5, 1, 16, 0, tzinfo=utc) # this year
156-
images[2].modified = datetime(2002, 6, 4, 16, 0, tzinfo=utc) # older
154+
images[0].created = datetime(2008, 8, 3, 16, 0, tzinfo=utc) # this month
155+
images[1].created = datetime(2008, 5, 1, 16, 0, tzinfo=utc) # this year
156+
images[2].created = datetime(2002, 6, 4, 16, 0, tzinfo=utc) # older
157157

158158
grouped = grouped_by_date(datetime(2008, 8, 8))
159159
assert grouped['This month'] == [img.id for img in images[0:1]]
@@ -164,8 +164,8 @@ def delete(images):
164164

165165
# catch a different set of intervals
166166
images = [collection.add('x.png', create_image()) for r in range(0, 2)]
167-
images[0].modified = datetime(2008, 7, 1, 16, 0, tzinfo=utc) # last month
168-
images[1].modified = datetime(2002, 6, 4, 16, 0, tzinfo=utc) # older
167+
images[0].created = datetime(2008, 7, 1, 16, 0, tzinfo=utc) # last month
168+
images[1].created = datetime(2002, 6, 4, 16, 0, tzinfo=utc) # older
169169

170170
grouped = grouped_by_date(datetime(2008, 8, 8))
171171
assert grouped['Last month'] == [img.id for img in images[0:1]]
@@ -175,13 +175,13 @@ def delete(images):
175175

176176
# use a different date and catch a reduced set of intervals
177177
images = [collection.add('x.png', create_image()) for r in range(0, 7)]
178-
images[0].modified = datetime(2008, 1, 3, 16, 0, tzinfo=utc) # this month
179-
images[1].modified = datetime(2008, 1, 2, 16, 0, tzinfo=utc) # this month
180-
images[2].modified = datetime(2008, 1, 1, 0, 0, tzinfo=utc) # this month
181-
images[3].modified = datetime(2007, 12, 14, 16, 0, tzinfo=utc) # lst month
182-
images[4].modified = datetime(2007, 12, 12, 16, 0, tzinfo=utc) # lst month
183-
images[5].modified = datetime(2007, 10, 2, 14, 0, tzinfo=utc) # last year
184-
images[6].modified = datetime(2002, 6, 4, 16, 0, tzinfo=utc) # older
178+
images[0].created = datetime(2008, 1, 3, 16, 0, tzinfo=utc) # this month
179+
images[1].created = datetime(2008, 1, 2, 16, 0, tzinfo=utc) # this month
180+
images[2].created = datetime(2008, 1, 1, 0, 0, tzinfo=utc) # this month
181+
images[3].created = datetime(2007, 12, 14, 16, 0, tzinfo=utc) # lst month
182+
images[4].created = datetime(2007, 12, 12, 16, 0, tzinfo=utc) # lst month
183+
images[5].created = datetime(2007, 10, 2, 14, 0, tzinfo=utc) # last year
184+
images[6].created = datetime(2002, 6, 4, 16, 0, tzinfo=utc) # older
185185

186186
grouped = grouped_by_date(datetime(2008, 1, 8))
187187
assert grouped['This month'] == [img.id for img in images[0:3]]

0 commit comments

Comments
 (0)