Exemplo n.º 1
0
 def setUp(self):
     TestCase.setUp(self)
     self.event = Event(title='meeting')
     self.duration = 2
     self.eventBegin = datetime.datetime(2013, 1, 7)
     self.eventEnd = self.eventBegin + datetime.timedelta(self.duration)
     self._resetEvent()
Exemplo n.º 2
0
class GroupagendaTest(TestCase):

    def setUp(self):
        TestCase.setUp(self)
        self.event = Event(title='meeting')
        self.duration = 2
        self.eventBegin = datetime.datetime(2013, 1, 7)
        self.eventEnd = self.eventBegin + datetime.timedelta(self.duration)
        self._resetEvent()

    def _resetEvent(self):
        self.event.event_begin = self.eventBegin
        self.event.event_end = self.eventEnd
        self.event.save()

    def testUpdateRecurring(self):
        """
        Test account notification command.
        """
        self.event.recurring = 'd'
        self.event.save()
        call_command('updateReccuringEvents')

        e = Event.objects.get(id=self.event.id)
        assert e.event_begin == self.eventBegin + datetime.timedelta(1)
        assert e.event_end == self.eventEnd + datetime.timedelta(1)

        self._resetEvent()
        self.event.event_end = None
        self.event.recurring = 'w'
        self.event.save()
        call_command('updateReccuringEvents')

        e = Event.objects.get(id=self.event.id)
        assert e.event_begin == self.eventBegin + datetime.timedelta(7)
        assert e.event_end == None
Exemplo n.º 3
0
# --------------------------------------------------------------
# ------------------------- BLOG -------------------------------
# --------------------------------------------------------------

if 'elephantblog' in settings.INSTALLED_APPS:
    from elephantblog.models import Entry as ElephantEntry
    from elephantblog.contents import QuoteContent
    
    ElephantEntry.register_regions(
        ('main', _('Main region')),
    )
    ElephantEntry.create_content_type(RichTextContent, cleanse=False, regions=('main',))
    ElephantEntry.create_content_type(CommentsContent)
    ElephantEntry.create_content_type(MediaFileContent, TYPE_CHOICES=MEDIA_TYPE_CHOICES)
    
    ElephantEntry.create_content_type(VideoContent)
    ElephantEntry.create_content_type(GalleryContent)
    ElephantEntry.create_content_type(QuoteContent)
    
    ElephantEntry.register_extensions('feincms.module.extensions.seo')

# ------------------------- ORGEVENT -------------------------------

if 'groupagenda' in settings.INSTALLED_APPS:
    from groupagenda.models import Event
    Event.register_regions(
        ('main', _('Main region')),
    )
    Event.create_content_type(RichTextContent)
    Event.create_content_type(CommentsContent)
    Event.create_content_type(MediaFileContent, TYPE_CHOICES=MEDIA_TYPE_CHOICES)