Exemplo n.º 1
0
    def test_get_container_recursive(self):
        for i in self.count_container_create:
            Container.objects.create(
                title=u"test 3 {0}".format(i), user=self.user, published=True, site=self.site, channel=self.channel3
            )

        get_container = get_container_by_channel("home2")
        self.assertEqual(len(get_container), 6)
Exemplo n.º 2
0
    def test_get_container_recursive(self):
        for i in self.count_container_create:
            Container.objects.create(title=u'test 3 {0}'.format(i),
                                     user=self.user,
                                     published=True,
                                     site=self.site,
                                     channel=self.channel3)

        get_container = get_container_by_channel('home2')
        self.assertEqual(len(get_container), 6)
Exemplo n.º 3
0
    def test_get_channel_with_magicdate(self):
        date = timezone.now() - timezone.timedelta(days=30)
        for i in self.count_container_create:
            Container.objects.create(title=u'test 3 {0}'.format(i),
                                     user=self.user,
                                     published=True,
                                     site=self.site,
                                     channel=self.channel,
                                     date_available=date)

        containers = get_container_by_channel('home', magic_date='30 days ago')

        self.assertEqual(containers.count(), len(self.count_container_create))
Exemplo n.º 4
0
    def test_get_channel_with_magicdate(self):
        date = timezone.now() - timezone.timedelta(days=30)
        for i in self.count_container_create:
            Container.objects.create(title=u'test 3 {}'.format(i),
                                     user=self.user,
                                     published=True,
                                     site=self.site,
                                     channel=self.channel,
                                     date_available=date
                                     )

        containers = get_container_by_channel('home',
                                              magic_date='30 days ago')

        self.assertEqual(containers.count(), len(self.count_container_create))
Exemplo n.º 5
0
 def test_tag_another_channel(self):
     get_container = get_container_by_channel('home2')
     self.assertEqual(len(get_container), 1)
     self.assertEqual(get_container[0].slug, "test-channel-2")
Exemplo n.º 6
0
 def test_tag_one_channel(self):
     get_container = get_container_by_channel('home')
     self.assertEqual(len(get_container), len(self.count_container_create))
     for c, i in zip(self.count_container_create[::-1], get_container):
         self.assertEqual(i.slug, "test-{}".format(c))
Exemplo n.º 7
0
 def test_tag_another_channel(self):
     get_container = get_container_by_channel('home2')
     self.assertEqual(len(get_container), 1)
     self.assertEqual(get_container[0].slug, "test-channel-2")
Exemplo n.º 8
0
 def test_tag_one_channel(self):
     get_container = get_container_by_channel('home')
     self.assertEqual(len(get_container), len(self.count_container_create))
     for c, i in zip(self.count_container_create[::-1], get_container):
         self.assertEqual(i.slug, "test-{0}".format(c))