# Path: sequence/models.py
# def sequence_list_name( sequence_number ):
# def sequence_campaign( sequence_number ):
# def sequence2dict( sequence_db ):
# def create_sequence( start_date, signup_close_date ):
# def get_all_sequences( ):
# def get_current_sequence( ):
# def get_current_sequence_number( ):


from django.test import TestCase
from sequence import models as sequence_model
from mock import patch
import datetime
        self.create_list_patcher = patch('sequence.models.mailgun_api.create_list')
        self.create_list_patch = self.create_list_patcher.start()

        self.create_campaign_patcher = patch('sequence.models.mailgun_api.create_campaign')
        self.create_campaign_patch = self.create_campaign_patcher.start()


    def tearDown(self):
        self.create_list_patcher.stop()
        self.create_campaign_patcher.stop()


    def test_create_sequence(self):
        now = datetime.datetime.utcnow().date()
        start_date = now + datetime.timedelta(weeks=8)
        signup_close_date = now + datetime.timedelta(weeks=7)

        sequence = sequence_model.create_sequence(
            start_date, signup_close_date
        )

        self.assertIn('global_list', sequence)
        self.assertIn('campaign_id', sequence)
        self.assertEquals(sequence['start_date'], start_date)
        self.assertEquals(sequence['signup_close_date'], signup_close_date)
        self.assertTrue(self.create_list_patch.called)
        self.assertTrue(self.create_campaign_patch.called)


    def test_get_current_sequence(self):

# Path: sequence/models.py
# def sequence_list_name( sequence_number ):
# def sequence_campaign( sequence_number ):
# def sequence2dict( sequence_db ):
# def create_sequence( start_date, signup_close_date ):
# def get_all_sequences( ):
# def get_current_sequence( ):
# def get_current_sequence_number( ):


# Path: sequence/tests.py
from django.test import TestCase
from sequence import models as sequence_model
from mock import patch
import datetime

        self.create_list_patcher = patch('sequence.models.mailgun_api.create_list')
        self.create_list_patch = self.create_list_patcher.start()

        self.create_campaign_patcher = patch('sequence.models.mailgun_api.create_campaign')
        self.create_campaign_patch = self.create_campaign_patcher.start()


    def tearDown(self):
        self.create_list_patcher.stop()
        self.create_campaign_patcher.stop()


    def test_create_sequence(self):
        now = datetime.datetime.utcnow().date()
        start_date = now + datetime.timedelta(weeks=8)
        signup_close_date = now + datetime.timedelta(weeks=7)

        sequence = sequence_model.create_sequence(
            start_date, signup_close_date
        )

        self.assertIn('global_list', sequence)
        self.assertIn('campaign_id', sequence)
        self.assertEquals(sequence['start_date'], start_date)
        self.assertEquals(sequence['signup_close_date'], signup_close_date)
        self.assertTrue(self.create_list_patch.called)
        self.assertTrue(self.create_campaign_patch.called)


    def test_get_current_sequence(self):

        current_sequence = sequence_model.get_current_sequence()