# Path: calfire_tracker/models.py
# class WildfireSource(models.Model):
#     """
#     describes a source of data for a wildfire
#     """
#     SIMPLE = "Simple Scrape"
#     COMPLEX = "Complex Scrape"
#     API = "API request"
# 
#     EXTRACTION_CHOICES = (
#         (SIMPLE, "Simple Scrape"),
#         (COMPLEX, "Complex Scrape"),
#         (API, "API request"),
#     )
# 
#     source_name = models.CharField("Data Source Name", db_index=True, unique=True, max_length=255)
#     source_short = models.CharField("Data Source Shortname", max_length=15)
#     source_slug = models.SlugField("Data Source Slug", unique=True, max_length=255, null=True, blank=True)
#     source_url = models.URLField("URL To Data Source", max_length=1024, null=True, blank=True)
#     source_active = models.BooleanField("Active Data Source?", default=False)
#     parent_tag = models.CharField("Parent HTML Tag", max_length=255, null=True, blank=True)
#     parent_attrib = models.CharField("Parent Attribute (id/class)", max_length=255, null=True, blank=True)
#     parent_selector = models.CharField("Parent Selector (id/class name)", max_length=255, null=True, blank=True)
#     target_tag = models.CharField("Target HTML Tag", max_length=255, null=True, blank=True)
#     target_attrib = models.CharField("Target Attribute (id/class)", max_length=255, null=True, blank=True)
#     target_selector = models.CharField("Target Selector (id/class name)", max_length=255, null=True, blank=True)
#     extraction_type = models.CharField("How Hard is Data Acquisition?", max_length=255, choices=EXTRACTION_CHOICES, default=SIMPLE)
#     target_index = models.IntegerField("List Element for Targeted Selector", max_length=3, null=True, blank=True)
#     data_paginated = models.BooleanField("Does the source use pagination?", default=False)
#     number_of_pages = models.IntegerField("How many pages?", max_length=5, null=True, blank=True)
#     created = models.DateTimeField("Date Created", auto_now_add=True)
#     modified = models.DateTimeField("Date Modified", auto_now=True)
# 
#     def __unicode__(self):
#         return self.source_short
# 
#     def save(self, *args, **kwargs):
#         super(WildfireSource, self).save(*args, **kwargs)


from django.test import SimpleTestCase, TestCase
from django.conf import settings
from calfire_tracker.models import WildfireSource
from requests.packages.urllib3.util.retry import Retry
from requests.adapters import HTTPAdapter
from BeautifulSoup import BeautifulSoup, Tag, BeautifulStoneSoup
import requests
import datetime
import logging
import re

logger = logging.getLogger("calfire_tracker")


class Compiler(TestCase):

    fixtures = ["calfire_tracker/fixtures/wildfire_sources.json"]

    def setUp(self):
        """
        setup some variables for our tests
        """
        logger.debug("Setting up tests")
        self.date_object = datetime.datetime.now()
        self.date_string = self.date_object.strftime("%Y_%m_%d_%H_%M_%S")

# Path: calfire_tracker/models.py
# class WildfireSource(models.Model):
#     """
#     describes a source of data for a wildfire
#     """
#     SIMPLE = "Simple Scrape"
#     COMPLEX = "Complex Scrape"
#     API = "API request"
# 
#     EXTRACTION_CHOICES = (
#         (SIMPLE, "Simple Scrape"),
#         (COMPLEX, "Complex Scrape"),
#         (API, "API request"),
#     )
# 
#     source_name = models.CharField("Data Source Name", db_index=True, unique=True, max_length=255)
#     source_short = models.CharField("Data Source Shortname", max_length=15)
#     source_slug = models.SlugField("Data Source Slug", unique=True, max_length=255, null=True, blank=True)
#     source_url = models.URLField("URL To Data Source", max_length=1024, null=True, blank=True)
#     source_active = models.BooleanField("Active Data Source?", default=False)
#     parent_tag = models.CharField("Parent HTML Tag", max_length=255, null=True, blank=True)
#     parent_attrib = models.CharField("Parent Attribute (id/class)", max_length=255, null=True, blank=True)
#     parent_selector = models.CharField("Parent Selector (id/class name)", max_length=255, null=True, blank=True)
#     target_tag = models.CharField("Target HTML Tag", max_length=255, null=True, blank=True)
#     target_attrib = models.CharField("Target Attribute (id/class)", max_length=255, null=True, blank=True)
#     target_selector = models.CharField("Target Selector (id/class name)", max_length=255, null=True, blank=True)
#     extraction_type = models.CharField("How Hard is Data Acquisition?", max_length=255, choices=EXTRACTION_CHOICES, default=SIMPLE)
#     target_index = models.IntegerField("List Element for Targeted Selector", max_length=3, null=True, blank=True)
#     data_paginated = models.BooleanField("Does the source use pagination?", default=False)
#     number_of_pages = models.IntegerField("How many pages?", max_length=5, null=True, blank=True)
#     created = models.DateTimeField("Date Created", auto_now_add=True)
#     modified = models.DateTimeField("Date Modified", auto_now=True)
# 
#     def __unicode__(self):
#         return self.source_short
# 
#     def save(self, *args, **kwargs):
#         super(WildfireSource, self).save(*args, **kwargs)


# Path: calfire_tracker/tests.py
from django.test import SimpleTestCase, TestCase
from django.conf import settings
from calfire_tracker.models import WildfireSource
from requests.packages.urllib3.util.retry import Retry
from requests.adapters import HTTPAdapter
from BeautifulSoup import BeautifulSoup, Tag, BeautifulStoneSoup
import requests
import datetime
import logging
import re


logger = logging.getLogger("calfire_tracker")


class Compiler(TestCase):

    fixtures = ["calfire_tracker/fixtures/wildfire_sources.json"]

    def setUp(self):
        """
        setup some variables for our tests
        """
        logger.debug("Setting up tests")
        self.date_object = datetime.datetime.now()
        self.date_string = self.date_object.strftime("%Y_%m_%d_%H_%M_%S")

        self.source = WildfireSource.objects.filter(source_short="calfire", source_active=True)[0]