<commit_before>import pytest
from pupa.scrape import Bill as ScrapeBill
from pupa.scrape import Organization as ScrapeOrganization
from pupa.importers import BillImporter, OrganizationImporter
from opencivicdata.models import Bill, Jurisdiction, Person, Organization


def create_jurisdiction():
    j = Jurisdiction.objects.create(id='jid', division_id='did')
    j.legislative_sessions.create(name='1899')
    j.legislative_sessions.create(name='1900')


def create_org():
    return Organization.objects.create(id='org-id', name='House', chamber='lower',
                                       classification='legislature', jurisdiction_id='jid')


@pytest.mark.django_db
def test_full_bill():
    create_jurisdiction()
    person = Person.objects.create(id='person-id', name='<NAME>')
    org = ScrapeOrganization(name='House', chamber='lower', classification='legislature')
    com = ScrapeOrganization(name='Arbitrary Committee', classification='committee',
                             parent_id=org._id)

    oldbill = ScrapeBill('HB 99', '1899', 'Axe & Tack Tax Act',
                         classification='tax bill', from_organization=org._id)

    bill = ScrapeBill('HB 1', '1900', 'Axe & Tack Tax Act',
                      classification='tax bill', from_organization=org._id)
    bill.subject = ['taxes', 'axes']
    bill.add_identifier('SB 9')
    bill.add_title('Tack & Axe Tax Act')
    bill.add_action('introduced in house', '1900-04-01', chamber='lower')
    act = bill.add_action('sent to arbitrary committee', '1900-04-04', chamber='lower')
    act.add_related_entity('arbitrary committee', 'organization', com._id)
    bill.add_related_bill("HB 99", legislative_session="1899", relation_type="prior-session")<commit_msg>Add an identifier to the test data.<commit_after>import pytest
from pupa.scrape import Bill as ScrapeBill
from pupa.scrape import Organization as ScrapeOrganization
from pupa.importers import BillImporter, OrganizationImporter
from opencivicdata.models import Bill, Jurisdiction, Person, Organization


def create_jurisdiction():
    j = Jurisdiction.objects.create(id='jid', division_id='did')
    j.legislative_sessions.create(identifier='1899', name='1899')
    j.legislative_sessions.create(identifier='1900', name='1900')


def create_org():
    return Organization.objects.create(id='org-id', name='House', chamber='lower',
                                       classification='legislature', jurisdiction_id='jid')


@pytest.mark.django_db
def test_full_bill():
    create_jurisdiction()
    person = Person.objects.create(id='person-id', name='<NAME>')
    org = ScrapeOrganization(name='House', chamber='lower', classification='legislature')
    com = ScrapeOrganization(name='Arbitrary Committee', classification='committee',
                             parent_id=org._id)

    oldbill = ScrapeBill('HB 99', '1899', 'Axe & Tack Tax Act',
                         classification='tax bill', from_organization=org._id)

    bill = ScrapeBill('HB 1', '1900', 'Axe & Tack Tax Act',
                      classification='tax bill', from_organization=org._id)
    bill.subject = ['taxes', 'axes']
    bill.add_identifier('SB 9')
    bill.add_title('Tack & Axe Tax Act')
    bill.add_action('introduced in house', '1900-04-01', chamber='lower')
    act = bill.add_action('sent to arbitrary committee', '1900-04-04', chamber='lower')
    act.add_related_entity('arbitrary committee', 'organization', com._id)
    bill.add_related_bill("HB 99", legislative_session="1899", relation_type="prior-session")
{'fraction_non_alphanumeric': 0.13098591549295774, 'fraction_numerical': 0.025915492957746478, 'mean_word_length': 4.102011494252873, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4927936', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1021, 'n_words': 223}