aboutsummaryrefslogblamecommitdiffstats
path: root/ctrack/organisations/tests/test_factories.py
blob: 68af6f5f807d13f58abfb3eb4ab5966d5b248780 (plain) (tree)























                               
                     













                                   
                                                                  
                       
import pytest

from .factories import (
    PersonFactory,
    ModeFactory,
    SubModeFactory,
    UserFactory,
    OrganisationFactory,
    RoleFactory)


def test_mode_factory():
    m = ModeFactory.build()
    assert m.descriptor


def test_submode_factory():
    sm = SubModeFactory.build()
    assert sm.descriptor
    assert sm.mode


def test_user_factory():
    u = UserFactory.build()
    assert u.username


def test_organisation_factory():
    o = OrganisationFactory.build()
    assert o.name


def test_role_factory():
    r = RoleFactory.build()
    assert r.name


def test_person_factory():
    r = RoleFactory.build()
    p = PersonFactory.build(role=r, predecessor__predecessor=None)
    assert p.first_name