# 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
        for advert in self.side_adverts:
            self.assertContains(response, advert.image)

    def test_only_active_ads_are_shown_on_top(self):
        """
        Test that only active adverts are shown on the top
        """

        # Inactive advert
        self.top_advert.status = Advertisement.INACTIVE
        self.top_advert.save()

        response = self.client.get(reverse('advert:top'))

        self.assertNotContains(response, self.top_advert.image)

        # Pending advert
        self.top_advert.status = Advertisement.PENDING
        self.top_advert.save()

        response = self.client.get(reverse('advert:top'))

        self.assertNotContains(response, self.top_advert.image)

    def test_only_active_ads_are_shown_on_side(self):
        """
        Test that only active adverts are shown on the side
        """

        # Inactive advert

# 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

        for advert in self.side_adverts:
            self.assertContains(response, advert.image)

    def test_only_active_ads_are_shown_on_top(self):
        """
        Test that only active adverts are shown on the top
        """

        # Inactive advert
        self.top_advert.status = Advertisement.INACTIVE
        self.top_advert.save()

        response = self.client.get(reverse('advert:top'))

        self.assertNotContains(response, self.top_advert.image)

        # Pending advert
        self.top_advert.status = Advertisement.PENDING
        self.top_advert.save()

        response = self.client.get(reverse('advert:top'))

        self.assertNotContains(response, self.top_advert.image)

    def test_only_active_ads_are_shown_on_side(self):
        """
        Test that only active adverts are shown on the side
        """

        # Inactive advert

        Advertisement.objects.filter(ad_type=Advertisement.SIDE_AD).update(status=Advertisement.INACTIVE)