Ejemplo n.º 1
0
def test_mixer(mixer):
    person = mixer.blend(Person)
    assert person.name
    assert person.id
    assert person.birthday

    pet = mixer.blend(Pet)
    assert pet.name
    assert pet.animal_type
    assert pet.owner

    with mixer.ctx(commit=True):
        person = mixer.blend(Person)
        assert person.id == 1
Ejemplo n.º 2
0
def test_mixer(mixer):
    person = mixer.blend(Person)
    assert person.name
    assert person.id
    assert person.birthday
    assert person.status in ('user', 'moderator', 'admin')

    pet = mixer.blend(Pet)
    assert pet.name
    assert pet.animal_type
    assert pet.owner

    with mixer.ctx(commit=False):
        person = mixer.blend(Person)
        assert person.id
Ejemplo n.º 3
0
def test_mixer(mixer):
    person = mixer.blend(Person)
    assert person.name
    assert person.id
    assert person.birthday
    assert person.status in ('user', 'moderator', 'admin')

    pet = mixer.blend(Pet)
    assert pet.name
    assert pet.animal_type
    assert pet.owner

    with mixer.ctx(commit=False):
        person = mixer.blend(Person)
        assert person.id
Ejemplo n.º 4
0
def test_mixer(mixer):
    person = mixer.blend(Person)
    assert person.name
    assert person.id
    assert person.birthday
    assert person.status in ("user", "moderator", "admin")

    pet = mixer.blend(Pet)
    assert pet.name
    assert pet.animal_type
    assert pet.owner

    with mixer.ctx(commit=True):
        person = mixer.blend(Person)
        assert person.id == 1
Ejemplo n.º 5
0
def test_mixer():
    from mixer.backend.peewee import mixer

    person = mixer.blend(Person)
    assert person.name
    assert person.id
    assert person.birthday

    pet = mixer.blend(Pet)
    assert pet.name
    assert pet.animal_type
    assert pet.owner

    with mixer.ctx(commit=True):
        person = mixer.blend(Person)
        assert person.id == 1