@pytest.fixture
def document(self, db_session):
    document = factories.Document()
    db_session.add(document)
    db_session.flush()
    return document
@pytest.fixture
def document(self, db_session):
    document = factories.Document()
    db_session.add(document)
    db_session.flush()
    return document