# Path: pupa/scrape/popolo.py
# class Post(BaseModel, LinkMixin, ContactDetailMixin):
#     """
#     A popolo-style Post
#     """
# 
#     _type = 'post'
#     _schema = post_schema
# 
#     def __init__(self, *, label, role, organization_id=None, chamber=None,
#                  division_id=None, start_date='', end_date='',
#                  maximum_memberships=1):
#         super(Post, self).__init__()
#         self.label = label
#         self.role = role
#         self.organization_id = pseudo_organization(organization_id, chamber)
#         self.division_id = division_id
#         self.start_date = start_date
#         self.end_date = end_date
#         self.maximum_memberships = maximum_memberships
# 
#     def __str__(self):
#         return self.label


import pytest
import datetime
from pupa.scrape import Post as ScrapePost
from pupa.importers import PostImporter, OrganizationImporter
from opencivicdata.core.models import Organization, Post, Division, Jurisdiction


def create_jurisdictions():
    Division.objects.create(id='ocd-division/country:us', name='USA')
    Division.objects.create(id='ocd-division/country:us/state:nc', name='NC')
    Jurisdiction.objects.create(id='us', division_id='ocd-division/country:us')
    Jurisdiction.objects.create(id='nc', division_id='ocd-division/country:us/state:nc')


@pytest.mark.django_db
def test_full_post():
    create_jurisdictions()
    org = Organization.objects.create(name="United States Executive Branch",
                                      classification="executive",
                                      jurisdiction_id="us")

# Path: pupa/scrape/popolo.py
# class Post(BaseModel, LinkMixin, ContactDetailMixin):
#     """
#     A popolo-style Post
#     """
# 
#     _type = 'post'
#     _schema = post_schema
# 
#     def __init__(self, *, label, role, organization_id=None, chamber=None,
#                  division_id=None, start_date='', end_date='',
#                  maximum_memberships=1):
#         super(Post, self).__init__()
#         self.label = label
#         self.role = role
#         self.organization_id = pseudo_organization(organization_id, chamber)
#         self.division_id = division_id
#         self.start_date = start_date
#         self.end_date = end_date
#         self.maximum_memberships = maximum_memberships
# 
#     def __str__(self):
#         return self.label


# Path: pupa/tests/importers/test_post_importer.py
import pytest
import datetime
from pupa.scrape import Post as ScrapePost
from pupa.importers import PostImporter, OrganizationImporter
from opencivicdata.core.models import Organization, Post, Division, Jurisdiction



def create_jurisdictions():
    Division.objects.create(id='ocd-division/country:us', name='USA')
    Division.objects.create(id='ocd-division/country:us/state:nc', name='NC')
    Jurisdiction.objects.create(id='us', division_id='ocd-division/country:us')
    Jurisdiction.objects.create(id='nc', division_id='ocd-division/country:us/state:nc')


@pytest.mark.django_db
def test_full_post():
    create_jurisdictions()
    org = Organization.objects.create(name="United States Executive Branch",
                                      classification="executive",
                                      jurisdiction_id="us")

    post = ScrapePost(label='executive', role='President',