Exemplo n.º 1
0
def test_create_full_jurisdiction_basic():
    nc = lookup(abbr="NC")
    create_full_jurisdiction(nc)

    assert Jurisdiction.objects.count() == 1
    juris = Jurisdiction.objects.get()
    assert juris.name == nc.name
    assert juris.organizations.count() == 4
    assert (juris.organizations.get(
        classification="executive").id == nc.executive_organization_id)
    assert (juris.organizations.get(
        classification="legislature").id == nc.legislature_organization_id)
    # 120 + 50
    assert Post.objects.count() == 170
Exemplo n.º 2
0
def test_create_federal_jurisdiction():
    us = lookup(abbr="US")
    create_full_jurisdiction(us)

    assert Jurisdiction.objects.count() == 1
    juris = Jurisdiction.objects.get()
    assert juris.name == us.name
    assert juris.classification == "country"
    assert juris.organizations.count() == 4
    assert (juris.organizations.get(
        classification="executive").id == us.executive_organization_id)
    assert (juris.organizations.get(
        classification="legislature").id == us.legislature_organization_id)
    # 435 House + 50 Senate posts + 2 territories (DC & PR for now)
    assert Post.objects.filter(role="Representative").count() == 435
    assert Post.objects.filter(role="Senator").count() == 50
    assert Post.objects.filter(role="Delegate").count() == 5
    assert Post.objects.filter(role="Resident Commissioner").count() == 1