# Path: advertisements/models.py
# class Provider(models.Model):
# class AdvertisementPanel(models.Model):
# class Advertisement(models.Model):
# class Click(models.Model):
#     def __unicode__(self):
#     def active_ads(self):
#     def active_ads_list(self):
#     def inactive_ads(self):
#     def total_clicks(self):
#     def get_absolute_url(self):
# def get_file_path(instance, filename):
#     def ad_display_num(self):
#     def total_width(self):
#     def total_height(self):
#     def get_adverts(self):
#     def get_absolute_url(self):
#     def get_iframe_url(self):
#     def __unicode__(self):
#     def __unicode__(self):
#     def clicked(self):
#     def click_history(self, history_days=10):
#     def get_absolute_url(self):
#     def get_signed_link(self):
#     def total_clicks(self):
#     ACTIVE = 'a'
#     INACTIVE = 'i'
#     PENDING = 'p'
#     STATUS_CHOICES = (
#         (ACTIVE, 'Active'),
#         (INACTIVE, 'Inactive'),
#         (PENDING, 'Pending'),
#     )


from django.test import TestCase
from advertisements.models import User, Provider, Advertisement
from django.core.urlresolvers import reverse
from model_mommy import mommy

        self.assertEqual(response.status_code, 200)
        self.assertIn('provider', response.context)
        self.assertEqual(response.context['provider'], attached_provider)

    def test_can_view_provider_list_page(self):
        """
        Test that an admin can view the admin overview page of all the providers
        """
        response = self.client.get(reverse('provider:list'))

        self.assertEqual(response.status_code, 200)

        self.assertIn('providers', response.context)
        self.assertEqual(len(response.context["providers"]), 1)
        self.assertEqual(response.context["providers"][0], self.provider)

    def test_can_view_any_request_page(self):
        """
        Test that an admin can view their own request page
        """

        # Provider 1
        response = self.client.get(
            reverse('provider:request', args=[self.provider.pk])
        )

        self.assertEqual(response.status_code, 200)

        # Second provider

# Path: advertisements/models.py
# class Provider(models.Model):
# class AdvertisementPanel(models.Model):
# class Advertisement(models.Model):
# class Click(models.Model):
#     def __unicode__(self):
#     def active_ads(self):
#     def active_ads_list(self):
#     def inactive_ads(self):
#     def total_clicks(self):
#     def get_absolute_url(self):
# def get_file_path(instance, filename):
#     def ad_display_num(self):
#     def total_width(self):
#     def total_height(self):
#     def get_adverts(self):
#     def get_absolute_url(self):
#     def get_iframe_url(self):
#     def __unicode__(self):
#     def __unicode__(self):
#     def clicked(self):
#     def click_history(self, history_days=10):
#     def get_absolute_url(self):
#     def get_signed_link(self):
#     def total_clicks(self):
#     ACTIVE = 'a'
#     INACTIVE = 'i'
#     PENDING = 'p'
#     STATUS_CHOICES = (
#         (ACTIVE, 'Active'),
#         (INACTIVE, 'Inactive'),
#         (PENDING, 'Pending'),
#     )


# Path: advertisements/tests/test_views.py
from django.test import TestCase
from advertisements.models import User, Provider, Advertisement
from django.core.urlresolvers import reverse
from model_mommy import mommy


        self.assertEqual(response.status_code, 200)
        self.assertIn('provider', response.context)
        self.assertEqual(response.context['provider'], attached_provider)

    def test_can_view_provider_list_page(self):
        """
        Test that an admin can view the admin overview page of all the providers
        """
        response = self.client.get(reverse('provider:list'))

        self.assertEqual(response.status_code, 200)

        self.assertIn('providers', response.context)
        self.assertEqual(len(response.context["providers"]), 1)
        self.assertEqual(response.context["providers"][0], self.provider)

    def test_can_view_any_request_page(self):
        """
        Test that an admin can view their own request page
        """

        # Provider 1
        response = self.client.get(
            reverse('provider:request', args=[self.provider.pk])
        )

        self.assertEqual(response.status_code, 200)

        # Second provider

        second_provider = mommy.make(Provider)