def context(): ctx = Context(crawler(), stage(), {"foo": "bar"}) # Assign a fake operation id, so that the DB doesn't complain about # NotNullContraint while saving events etc. ctx.operation_id = randint(1, 99999) return ctx
def get_context(): ctx = Context(get_crawler(), get_stage(), {"foo": "bar"}) ctx.run_id = str(uuid.uuid4()) return ctx