mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-19 09:01:54 -05:00
18 lines
456 B
Python
18 lines
456 B
Python
from app.dao.events_dao import dao_create_event
|
|
from app.models import Event
|
|
|
|
|
|
def test_create_event(notify_db_session):
|
|
assert Event.query.count() == 0
|
|
data = {
|
|
"event_type": "sucessful_login",
|
|
"data": {"something": "random", "in_fact": "could be anything"},
|
|
}
|
|
|
|
event = Event(**data)
|
|
dao_create_event(event)
|
|
|
|
assert Event.query.count() == 1
|
|
event_from_db = Event.query.first()
|
|
assert event == event_from_db
|