Exemple #1
0
 def test_gbobjects_published(self):
     self.assertEquals(
         gbobjects_published(Gbobject.objects.all()).count(), 1)
     self.gbobject_2.status = PUBLISHED
     self.gbobject_2.save()
     self.assertEquals(
         gbobjects_published(Gbobject.objects.all()).count(), 2)
     self.gbobject_1.sites.clear()
     self.assertEquals(
         gbobjects_published(Gbobject.objects.all()).count(), 1)
     self.gbobject_1.sites.add(*self.sites)
     self.gbobject_1.start_publication = datetime(2020, 1, 1)
     self.gbobject_1.save()
     self.assertEquals(
         gbobjects_published(Gbobject.objects.all()).count(), 1)
     self.gbobject_1.start_publication = datetime(2000, 1, 1)
     self.gbobject_1.save()
     self.assertEquals(
         gbobjects_published(Gbobject.objects.all()).count(), 2)
     self.gbobject_1.end_publication = datetime(2000, 1, 1)
     self.gbobject_1.save()
     self.assertEquals(
         gbobjects_published(Gbobject.objects.all()).count(), 1)
     self.gbobject_1.end_publication = datetime(2020, 1, 1)
     self.gbobject_1.save()
     self.assertEquals(
         gbobjects_published(Gbobject.objects.all()).count(), 2)
Exemple #2
0
 def test_gbobjects_published(self):
     self.assertEquals(gbobjects_published(Gbobject.objects.all()).count(), 1)
     self.gbobject_2.status = PUBLISHED
     self.gbobject_2.save()
     self.assertEquals(gbobjects_published(Gbobject.objects.all()).count(), 2)
     self.gbobject_1.sites.clear()
     self.assertEquals(gbobjects_published(Gbobject.objects.all()).count(), 1)
     self.gbobject_1.sites.add(*self.sites)
     self.gbobject_1.start_publication = datetime(2020, 1, 1)
     self.gbobject_1.save()
     self.assertEquals(gbobjects_published(Gbobject.objects.all()).count(), 1)
     self.gbobject_1.start_publication = datetime(2000, 1, 1)
     self.gbobject_1.save()
     self.assertEquals(gbobjects_published(Gbobject.objects.all()).count(), 2)
     self.gbobject_1.end_publication = datetime(2000, 1, 1)
     self.gbobject_1.save()
     self.assertEquals(gbobjects_published(Gbobject.objects.all()).count(), 1)
     self.gbobject_1.end_publication = datetime(2020, 1, 1)
     self.gbobject_1.save()
     self.assertEquals(gbobjects_published(Gbobject.objects.all()).count(), 2)
 def gbobjects_published(self):
     """Return only the gbobjects published"""
     return gbobjects_published(self.gbobjects)
 def related_published(self):
     """Return only related gbobjects published"""
     return gbobjects_published(self.related)
Exemple #5
0
 def related_published(self):
     """Return only related gbobjects published"""
     return gbobjects_published(self.related)
Exemple #6
0
 def items(self, obj):
     """Items are the published gbobjects of the author"""
     return gbobjects_published(obj.gbobjects)[:FEEDS_MAX_ITEMS]
Exemple #7
0
 def gbobjects_published(self):
     """Return only the gbobjects published"""
     return gbobjects_published(self.gbobjects)