コード例 #1
0
ファイル: tests.py プロジェクト: Spring-Apps/rapidpro
    def test_icon(self):
        from temba.campaigns.models import Campaign
        from temba.triggers.models import Trigger
        from temba.flows.models import Flow
        from temba.utils.templatetags.temba import icon

        campaign = Campaign.create(self.org, self.admin, 'Test Campaign', self.create_group('Test group', []))
        flow = Flow.create(self.org, self.admin, 'Test Flow')
        trigger = Trigger.objects.create(org=self.org, keyword='trigger', flow=flow, created_by=self.admin, modified_by=self.admin)

        self.assertEquals('icon-instant', icon(campaign))
        self.assertEquals('icon-feed', icon(trigger))
        self.assertEquals('icon-tree', icon(flow))
        self.assertEquals("", icon(None))
コード例 #2
0
    def test_icon(self):
        from temba.campaigns.models import Campaign
        from temba.triggers.models import Trigger
        from temba.flows.models import Flow
        from temba.utils.templatetags.temba import icon

        campaign = Campaign.create(self.org, self.admin, 'Test Campaign', self.create_group('Test group', []))
        flow = Flow.create(self.org, self.admin, 'Test Flow')
        trigger = Trigger.objects.create(org=self.org, keyword='trigger', flow=flow, created_by=self.admin, modified_by=self.admin)

        self.assertEquals('icon-instant', icon(campaign))
        self.assertEquals('icon-feed', icon(trigger))
        self.assertEquals('icon-tree', icon(flow))
        self.assertEquals("", icon(None))