18 lines
547 B
Python
18 lines
547 B
Python
import pytest
|
|
from werkzeug.exceptions import BadRequest
|
|
|
|
import flaschengeist.plugins.events.event_controller as event_controller
|
|
from flaschengeist.plugins.events.models import EventType
|
|
|
|
VALID_TOKEN = "f4ecbe14be3527ca998143a49200e294"
|
|
EVENT_TYPE_NAME = "Test Type"
|
|
|
|
|
|
def test_create_event_type(app):
|
|
with app.app_context():
|
|
type = event_controller.create_event_type(EVENT_TYPE_NAME)
|
|
assert isinstance(type, EventType)
|
|
|
|
with pytest.raises(BadRequest):
|
|
event_controller.create_event_type(EVENT_TYPE_NAME)
|