mirror of
https://github.com/Tech-Workers-Coalition-Italia/mobilizon-reshare.git
synced 2025-06-05 21:09:12 +02:00
added begins_before
This commit is contained in:
@@ -40,3 +40,29 @@ def test_format(event, simple_template):
|
||||
event.format(simple_template)
|
||||
== "test event|description of the event|location|2021-01-01, 11:30"
|
||||
)
|
||||
|
||||
|
||||
def test_is_newer():
|
||||
older_event = MobilizonEvent(
|
||||
name="test event",
|
||||
description="description of the event",
|
||||
begin_datetime=datetime(year=2021, month=1, day=1, hour=11, minute=30),
|
||||
end_datetime=datetime(year=2021, month=1, day=1, hour=12, minute=30),
|
||||
last_accessed=datetime.now(),
|
||||
mobilizon_link="http://some_link.com/123",
|
||||
mobilizon_id="12345",
|
||||
thumbnail_link="http://some_link.com/123.jpg",
|
||||
location="location",
|
||||
)
|
||||
newer_event = MobilizonEvent(
|
||||
name="test event",
|
||||
description="description of the event",
|
||||
begin_datetime=datetime(year=2021, month=1, day=2, hour=11, minute=30),
|
||||
end_datetime=datetime(year=2021, month=1, day=1, hour=12, minute=30),
|
||||
last_accessed=datetime.now(),
|
||||
mobilizon_link="http://some_link.com/123",
|
||||
mobilizon_id="12345",
|
||||
thumbnail_link="http://some_link.com/123.jpg",
|
||||
location="location",
|
||||
)
|
||||
assert older_event.begins_before(newer_event)
|
||||
|
||||
Reference in New Issue
Block a user