Exemplo n.º 1
0
 def _create_event(id_=None, legacy=False):
     conf = MockConference()
     # we specify `acl_entries` so SA doesn't load it when accessing it for
     # the first time, which would require no_autoflush blocks in some cases
     conf.as_event = Event(id=id_, creator=dummy_user, acl_entries=set())
     db.session.flush()
     conf.id = str(conf.as_event.id)
     ch.add(conf)
     _events.append(conf)
     return conf if legacy else conf.as_event
Exemplo n.º 2
0
 def _create_event(id_=None, legacy=False):
     conf = MockConference()
     # we specify `acl_entries` so SA doesn't load it when accessing it for
     # the first time, which would require no_autoflush blocks in some cases
     conf.as_event = Event(id=id_, creator=dummy_user, acl_entries=set())
     db.session.flush()
     conf.id = str(conf.as_event.id)
     ch.add(conf)
     _events.append(conf)
     return conf if legacy else conf.as_event
Exemplo n.º 3
0
 def _create_event(id_=None, legacy=False, **kwargs):
     conf = MockConference()
     # we specify `acl_entries` so SA doesn't load it when accessing it for
     # the first time, which would require no_autoflush blocks in some cases
     now = now_utc(exact=False)
     kwargs.setdefault("title", u"dummy#{}".format(id_) if id_ is not None else u"dummy")
     kwargs.setdefault("start_dt", now)
     kwargs.setdefault("end_dt", now + timedelta(hours=1))
     kwargs.setdefault("timezone", "UTC")
     conf.as_event = Event(id=id_, creator=dummy_user, acl_entries=set(), category_id=1, **kwargs)
     conf.as_event.category_chain = [1, 0]  # set after __init__ (setting category_id modifies it)
     db.session.flush()
     conf.id = str(conf.as_event.id)
     ch.add(conf)
     _events.append(conf)
     return conf if legacy else conf.as_event
Exemplo n.º 4
0
 def _create_event(id_=None, legacy=False, **kwargs):
     conf = MockConference()
     # we specify `acl_entries` so SA doesn't load it when accessing it for
     # the first time, which would require no_autoflush blocks in some cases
     now = now_utc(exact=False)
     kwargs.setdefault('type_', EventType.meeting)
     kwargs.setdefault('title', u'dummy#{}'.format(id_) if id_ is not None else u'dummy')
     kwargs.setdefault('start_dt', now)
     kwargs.setdefault('end_dt', now + timedelta(hours=1))
     kwargs.setdefault('timezone', 'UTC')
     kwargs.setdefault('category', dummy_category)
     conf.as_event = Event(id=id_, creator=dummy_user, acl_entries=set(), **kwargs)
     db.session.flush()
     conf.id = str(conf.as_event.id)
     ch.add(conf)
     _events.append(conf)
     return conf if legacy else conf.as_event
Exemplo n.º 5
0
 def _create_event(id_=None, legacy=False, **kwargs):
     conf = MockConference()
     # we specify `acl_entries` so SA doesn't load it when accessing it for
     # the first time, which would require no_autoflush blocks in some cases
     now = now_utc(exact=False)
     kwargs.setdefault('type_', EventType.meeting)
     kwargs.setdefault(
         'title', u'dummy#{}'.format(id_) if id_ is not None else u'dummy')
     kwargs.setdefault('start_dt', now)
     kwargs.setdefault('end_dt', now + timedelta(hours=1))
     kwargs.setdefault('timezone', 'UTC')
     kwargs.setdefault('category', dummy_category)
     conf.as_event = Event(id=id_,
                           creator=dummy_user,
                           acl_entries=set(),
                           **kwargs)
     db.session.flush()
     conf.id = str(conf.as_event.id)
     ch.add(conf)
     _events.append(conf)
     return conf if legacy else conf.as_event
Exemplo n.º 6
0
 def _create_event(id_):
     event = MockConference()
     event.id = id_
     ch.add(event)
     _events.append(event)
     return event
Exemplo n.º 7
0
 def _create_event(id_):
     event = MockConference()
     event.id = id_
     ch.add(event)
     _events.append(event)
     return event