コード例 #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)
コード例 #2
0
ファイル: managers.py プロジェクト: Big-Data/gnowsys-studio
 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)
コード例 #3
0
ファイル: models.py プロジェクト: divya-basant/django-gstudio
 def gbobjects_published(self):
     """Return only the gbobjects published"""
     return gbobjects_published(self.gbobjects)
コード例 #4
0
ファイル: models.py プロジェクト: divya-basant/django-gstudio
 def related_published(self):
     """Return only related gbobjects published"""
     return gbobjects_published(self.related)
コード例 #5
0
ファイル: models.py プロジェクト: gnowgi/django-gstudio
 def related_published(self):
     """Return only related gbobjects published"""
     return gbobjects_published(self.related)
コード例 #6
0
ファイル: feeds.py プロジェクト: divya-basant/django-gstudio
 def items(self, obj):
     """Items are the published gbobjects of the author"""
     return gbobjects_published(obj.gbobjects)[:FEEDS_MAX_ITEMS]
コード例 #7
0
ファイル: models.py プロジェクト: Dhiru/gnowsys-studio
 def gbobjects_published(self):
     """Return only the gbobjects published"""
     return gbobjects_published(self.gbobjects)