예제 #1
0
 def test_nodetypes_published(self):
     self.assertEquals(
         nodetypes_published(Nodetype.objects.all()).count(), 1)
     self.nodetype_2.status = PUBLISHED
     self.nodetype_2.save()
     self.assertEquals(
         nodetypes_published(Nodetype.objects.all()).count(), 2)
     self.nodetype_1.sites.clear()
     self.assertEquals(
         nodetypes_published(Nodetype.objects.all()).count(), 1)
     self.nodetype_1.sites.add(*self.sites)
     self.nodetype_1.start_publication = datetime(2020, 1, 1)
     self.nodetype_1.save()
     self.assertEquals(
         nodetypes_published(Nodetype.objects.all()).count(), 1)
     self.nodetype_1.start_publication = datetime(2000, 1, 1)
     self.nodetype_1.save()
     self.assertEquals(
         nodetypes_published(Nodetype.objects.all()).count(), 2)
     self.nodetype_1.end_publication = datetime(2000, 1, 1)
     self.nodetype_1.save()
     self.assertEquals(
         nodetypes_published(Nodetype.objects.all()).count(), 1)
     self.nodetype_1.end_publication = datetime(2020, 1, 1)
     self.nodetype_1.save()
     self.assertEquals(
         nodetypes_published(Nodetype.objects.all()).count(), 2)
예제 #2
0
 def test_nodetypes_published(self):
     self.assertEquals(nodetypes_published(Nodetype.objects.all()).count(), 1)
     self.nodetype_2.status = PUBLISHED
     self.nodetype_2.save()
     self.assertEquals(nodetypes_published(Nodetype.objects.all()).count(), 2)
     self.nodetype_1.sites.clear()
     self.assertEquals(nodetypes_published(Nodetype.objects.all()).count(), 1)
     self.nodetype_1.sites.add(*self.sites)
     self.nodetype_1.start_publication = datetime(2020, 1, 1)
     self.nodetype_1.save()
     self.assertEquals(nodetypes_published(Nodetype.objects.all()).count(), 1)
     self.nodetype_1.start_publication = datetime(2000, 1, 1)
     self.nodetype_1.save()
     self.assertEquals(nodetypes_published(Nodetype.objects.all()).count(), 2)
     self.nodetype_1.end_publication = datetime(2000, 1, 1)
     self.nodetype_1.save()
     self.assertEquals(nodetypes_published(Nodetype.objects.all()).count(), 1)
     self.nodetype_1.end_publication = datetime(2020, 1, 1)
     self.nodetype_1.save()
     self.assertEquals(nodetypes_published(Nodetype.objects.all()).count(), 2)
예제 #3
0
파일: feeds.py 프로젝트: PhiTheta/ISON
 def items(self, obj):
     """Items are the published nodetypes of the author"""
     return nodetypes_published(obj.nodetypes)[:FEEDS_MAX_ITEMS]
예제 #4
0
 def related_published(self):
     """Return only related nodetypes published"""
     return nodetypes_published(self.related)
예제 #5
0
 def nodetypes_published(self):
     """
     Return only the published nodetypes 
     """
     return nodetypes_published(self.nodetypes)
예제 #6
0
 def nodetypes_published(self):
     """Return only the nodetypes published"""
     return nodetypes_published(self.nodetypes)
예제 #7
0
 def related_published(self):
     """Return only related nodetypes published"""
     return nodetypes_published(self.related)