Exemplo n.º 1
0
    def get_or_create_dummy(cls):
        from content.models import SiteSettings
        site_settings, unused = SiteSettings.get_or_create_dummy()

        obj, created = cls.objects.get_or_create(
            title='Dummy banner',
            url='http://example.com',
            image_file='dummy.jpg',
        )

        if created:
            obj.sites = [site_settings.site,]
            obj.save()

        return obj, created
Exemplo n.º 2
0
    def setUp(self):
        self.site_settings, unused = SiteSettings.get_or_create_dummy()
        self.site = self.site_settings.site

        self.client = Client(HTTP_HOST=self.site.domain)
Exemplo n.º 3
0
 def setUp(self):
     self.site_settings, unused = SiteSettings.get_or_create_dummy()
     self.site = self.site_settings.site
     self.banner, unused = Banner.get_or_create_dummy()