Ejemplo n.º 1
0
def user(session: Session) -> User:
    test_user = create_model(
        session, User,
        username='******',
        password='******',
        email='*****@*****.**',
        language='english'
    )
    yield test_user
    delete_instance(session, test_user)
Ejemplo n.º 2
0
def sender(session: Session) -> User:
    sender = create_model(
        session, User,
        username='******',
        password='******',
        email='*****@*****.**',
        language='english'
    )
    yield sender
    delete_instance(session, sender)
Ejemplo n.º 3
0
def bad_user(session: Session) -> User:
    test_user = create_model(
        session,
        User,
        username='******',
        password='******',
        email='test.email#gmail.com',
    )
    yield test_user
    delete_instance(session, test_user)
Ejemplo n.º 4
0
def zodiac1(session: Session) -> Zodiac:
    zodiac = create_model(
        session, Zodiac,
        name="aries",
        start_month=3,
        start_day_in_month=20,
        end_month=4,
        end_day_in_month=19,
    )
    yield zodiac
    delete_instance(session, zodiac)
Ejemplo n.º 5
0
def invitation(event: Event, user: User, session: Session) -> Event:
    invitation = create_model(
        session,
        Invitation,
        creation=datetime.now(),
        recipient=user,
        event=event,
        event_id=event.id,
        recipient_id=user.id,
    )
    yield invitation
    delete_instance(session, invitation)
Ejemplo n.º 6
0
def add_quote(session: Session, id_quote: int, text: str,
              author: str) -> Quote:
    quote = create_model(session, Quote, id=id_quote, text=text, author=author)
    yield quote
    delete_instance(session, quote)