Пример #1
0
 def test_activity_segment_admin(self):
     event = EventFactory.create()
     event_url = reverse('admin:events_event_change', args=(event.id, ))
     response = self.client.get(event_url)
     self.assertNotContains(response, 'Segment:')
     segment_type = SegmentTypeFactory.create()
     SegmentFactory.create_batch(5, type=segment_type)
     response = self.client.get(event_url)
     self.assertContains(response, 'Segment:')
Пример #2
0
    def setUp(self):
        super(SegmentTypeListAPITestCase, self).setUp()

        self.client = JSONAPITestClient()

        self.url = reverse('segment-type-list')
        self.user = BlueBottleUserFactory()

        for i in range(5):
            segment_type = SegmentTypeFactory.create()
            SegmentFactory.create_batch(3, type=segment_type)
Пример #3
0
    def test_segment_admin(self):
        segment_type = SegmentTypeFactory.create()
        SegmentFactory.create_batch(5, type=segment_type)

        segment_url = reverse('admin:segments_segmenttype_change',
                              args=(segment_type.id, ))
        response = self.client.get(segment_url)
        self.assertContains(response, 'Segment')

        list_url = reverse('admin:segments_segmenttype_changelist')
        response = self.client.get(list_url)
        self.assertContains(response, 'Number of segments')
Пример #4
0
    def setUp(self):
        super(SegmentListAPITestCase, self).setUp()

        self.client = JSONAPITestClient()

        self.url = reverse('segment-list')
        self.user = BlueBottleUserFactory()
        self.segment_type = SegmentTypeFactory.create()
        self.segments = SegmentFactory.create_batch(20, type=self.segment_type)