# Path: dashboard/apps/hub/models.py
# class ProxyUser(User):
#     class Meta:
# class Office(models.Model):
#     class Meta:
# class Organization(models.Model):
#     class Meta:
# class DataFormat(models.Model):
#     class Meta:
# class State(models.Model):
#     class Meta:
# class Election(models.Model):
#     class Meta:
# class BaseContact(models.Model):
#     class Meta:
# class VolunteerRole(models.Model):
# class Volunteer(BaseContact):
# class BaseLog(models.Model):
#     class Meta:
# class Log(BaseLog):
#     class Meta:
# class VolunteerLog(BaseLog):
#     def __str__(self):
#     def __str__(self):
#     def __repr__(self):
#     def save(self, *args, **kwargs):
#     def __str__(self):
#     def save(self, *args, **kwargs):
#     def __str__(self):
#     def __str__(self):
#     def status_entry(self):
#     def results_status(self):
#     def save(self, *args, **kwargs):
#     def clean(self):
#     def __str__(self):
#     def __repr__(self):
#     def _perform_unique_checks(self, unique_checks):
#     def offices(self):
#     def offices_for_api(self):
#     def reporting_levels(self):
#     def elec_key(self, as_string=False):
#     def slug(self):
#     def division(self):
#     def __str__(self):
#     def __str__(self):
#     def full_name(self):
#     def status_entry(self):
#     def __str__(self):
#     def __repr__(self):
#     def log_key(self, as_string=False):
#     def __str__(self):
#     def __repr__(self):
#     def log_key(self, as_string=False):
#     GOV_LEVELS = (
#         ('county', 'County'),
#         ('state','State'),
#         ('federal','Federal'),
#         ('local', 'Local')
#     )
#     STATUS_OPTIONS = (
#         ('not-started', 'Not Started'),
#         ('partial', 'Partial'),
#         ('up-to-date', 'Up-to-date'),
#     )
#     PAIN_CHOICES = (
#         ('easy', 'Easy'),
#         ('medium', 'Medium'),
#         ('hard', 'Hard'),
#         ('excruciating', 'Excruciating'),
#     )
#     RACE_CHOICES = (
#         ('primary', 'Primary'),
#         ('primary-recall', 'Primary Recall'),
#         ('general', 'General'),
#         ('general-recall', 'General Recall'),
#         ('primary-runoff', 'Primary Runoff'),
#         ('general-runoff', 'General Runoff'),
#     )
#     RESULT_CHOICES = (
#         ('certified', 'Certified'),
#         ('unofficial', 'Unofficial'),
#     )
#     PRIMARY_TYPE_CHOICES = (
#         ('blanket', 'Blanket'),
#         ('closed', 'Closed'),
#         ('open', 'Open'),
#         ('semi-closed', 'Semi-closed'),
#         ('semi-open', 'Semi-open'),
#         ('other', 'Other'),
#     )
#     LEVEL_STATUS_CHOICES = (
#         ('yes', 'Yes - Will be included'),
#         ('no', 'No - Will not be included'),
#         ('unknown', 'Unsure if exists'),
#         ('Unavailable', 'Not available'),
#         ('baked-raw', 'Baked Raw'),
#         ('baked', 'Baked'),
#     )


import unittest
import mock
from django.core.exceptions import ValidationError
from django.db.models import Q
from django.db.models.query import QuerySet
from django.test import TestCase
from ..models import Contact, Election, Log, State, Volunteer



class ElectionTest(TestCase):

    fixtures = [
        'test_elecdata_model'
    ]

    def test_offices(self):
        "Election.offices should return tuple of offices up for election"
        # Florida 2012 races
        general = Election.objects.get(pk=4)
        gop_primary = Election.objects.get(pk=30)
        gop_prez_primary = Election.objects.get(pk=31)

        self.assertEqual(general.offices, ('prez', 'senate', 'house', 'state_officers', 'state_leg'))
        self.assertEqual(gop_primary.offices, ('senate', 'house', 'state_leg'))
        self.assertEqual(gop_prez_primary.offices, ('prez',))

    def test_elec_key(self):
        "Election.elec_key can return tuple or string election key"
        # Florida 2012 races
        general = Election.objects.get(pk=4)
        gop_primary = Election.objects.get(pk=30)

# Path: dashboard/apps/hub/models.py
# class ProxyUser(User):
#     class Meta:
# class Office(models.Model):
#     class Meta:
# class Organization(models.Model):
#     class Meta:
# class DataFormat(models.Model):
#     class Meta:
# class State(models.Model):
#     class Meta:
# class Election(models.Model):
#     class Meta:
# class BaseContact(models.Model):
#     class Meta:
# class VolunteerRole(models.Model):
# class Volunteer(BaseContact):
# class BaseLog(models.Model):
#     class Meta:
# class Log(BaseLog):
#     class Meta:
# class VolunteerLog(BaseLog):
#     def __str__(self):
#     def __str__(self):
#     def __repr__(self):
#     def save(self, *args, **kwargs):
#     def __str__(self):
#     def save(self, *args, **kwargs):
#     def __str__(self):
#     def __str__(self):
#     def status_entry(self):
#     def results_status(self):
#     def save(self, *args, **kwargs):
#     def clean(self):
#     def __str__(self):
#     def __repr__(self):
#     def _perform_unique_checks(self, unique_checks):
#     def offices(self):
#     def offices_for_api(self):
#     def reporting_levels(self):
#     def elec_key(self, as_string=False):
#     def slug(self):
#     def division(self):
#     def __str__(self):
#     def __str__(self):
#     def full_name(self):
#     def status_entry(self):
#     def __str__(self):
#     def __repr__(self):
#     def log_key(self, as_string=False):
#     def __str__(self):
#     def __repr__(self):
#     def log_key(self, as_string=False):
#     GOV_LEVELS = (
#         ('county', 'County'),
#         ('state','State'),
#         ('federal','Federal'),
#         ('local', 'Local')
#     )
#     STATUS_OPTIONS = (
#         ('not-started', 'Not Started'),
#         ('partial', 'Partial'),
#         ('up-to-date', 'Up-to-date'),
#     )
#     PAIN_CHOICES = (
#         ('easy', 'Easy'),
#         ('medium', 'Medium'),
#         ('hard', 'Hard'),
#         ('excruciating', 'Excruciating'),
#     )
#     RACE_CHOICES = (
#         ('primary', 'Primary'),
#         ('primary-recall', 'Primary Recall'),
#         ('general', 'General'),
#         ('general-recall', 'General Recall'),
#         ('primary-runoff', 'Primary Runoff'),
#         ('general-runoff', 'General Runoff'),
#     )
#     RESULT_CHOICES = (
#         ('certified', 'Certified'),
#         ('unofficial', 'Unofficial'),
#     )
#     PRIMARY_TYPE_CHOICES = (
#         ('blanket', 'Blanket'),
#         ('closed', 'Closed'),
#         ('open', 'Open'),
#         ('semi-closed', 'Semi-closed'),
#         ('semi-open', 'Semi-open'),
#         ('other', 'Other'),
#     )
#     LEVEL_STATUS_CHOICES = (
#         ('yes', 'Yes - Will be included'),
#         ('no', 'No - Will not be included'),
#         ('unknown', 'Unsure if exists'),
#         ('Unavailable', 'Not available'),
#         ('baked-raw', 'Baked Raw'),
#         ('baked', 'Baked'),
#     )


# Path: dashboard/apps/hub/tests/test_models.py
import unittest
import mock
from django.core.exceptions import ValidationError
from django.db.models import Q
from django.db.models.query import QuerySet
from django.test import TestCase
from ..models import Contact, Election, Log, State, Volunteer




class ElectionTest(TestCase):

    fixtures = [
        'test_elecdata_model'
    ]

    def test_offices(self):
        "Election.offices should return tuple of offices up for election"
        # Florida 2012 races
        general = Election.objects.get(pk=4)
        gop_primary = Election.objects.get(pk=30)
        gop_prez_primary = Election.objects.get(pk=31)

        self.assertEqual(general.offices, ('prez', 'senate', 'house', 'state_officers', 'state_leg'))
        self.assertEqual(gop_primary.offices, ('senate', 'house', 'state_leg'))
        self.assertEqual(gop_prez_primary.offices, ('prez',))

    def test_elec_key(self):
        "Election.elec_key can return tuple or string election key"
        # Florida 2012 races
        general = Election.objects.get(pk=4)
        gop_primary = Election.objects.get(pk=30)

        gop_prez_primary = Election.objects.get(pk=31)