<commit_before>from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter
from pathlib import Path


def make_base_folder_path():
    base_folder_path = Path.cwd() / Path("test_data/pollingstations_data/EXE")
    return str(base_folder_path)


class Command(BaseXpressDemocracyClubCsvImporter):
    local_files = True
    base_folder_path = make_base_folder_path()
    council_id = "EXE"
    addresses_name = "Democracy_Club__02May2019exe.CSV"
    stations_name = "Democracy_Club__02May2019exe.CSV"<commit_msg>Add Advance Voting stations to fake Exeter importer<commit_after>from django.contrib.gis.geos import Point

from addressbase.models import UprnToCouncil
from data_importers.mixins import AdvanceVotingMixin
from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter
from pathlib import Path

from pollingstations.models import AdvanceVotingStation


def make_base_folder_path():
    base_folder_path = Path.cwd() / Path("test_data/pollingstations_data/EXE")
    return str(base_folder_path)


class Command(BaseXpressDemocracyClubCsvImporter, AdvanceVotingMixin):
    local_files = True
    base_folder_path = make_base_folder_path()
    council_id = "EXE"
    addresses_name = "Democracy_Club__02May2019exe.CSV"
    stations_name = "Democracy_Club__02May2019exe.CSV"

    def add_advance_voting_stations(self):
        advance_station = AdvanceVotingStation(
            name="<NAME>",
            address="""Exeter City Council
            Civic Centre
            Paris Street
            Exeter
            Devon
            """,
            postcode="EX1 1JN",
            location=Point(-3.5245510056787057, 50.72486002944331, srid=4326),
        )
        advance_station.save()
        UprnToCouncil.objects.filter(lad=self.council.geography.gss).update(
            advance_voting_station=advance_station
        )
{'fraction_non_alphanumeric': 0.07135250266240682, 'fraction_numerical': 0.03354632587859425, 'mean_word_length': 3.944736842105263, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4047743', 'n_tokens_mistral': 659, 'n_tokens_neox': 590, 'n_words': 99}