How to use the kobo.hub.models.Channel.objects.create function in kobo

To help you get started, we’ve selected a few kobo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github release-engineering / kobo / tests / test_task_logs.py View on Github external
def setUp(self):
        self._fixture_teardown()
        super(TestTaskLogs, self).setUp()

        self.cleanDataDirs()

        # These objects are required to exist but their attributes are irrelevant
        user = User.objects.create()
        arch = Arch.objects.create(name='testarch')
        channel = Channel.objects.create(name='testchannel')

        test_task = Task.objects.create(
            pk=TASK_ID, arch=arch, channel=channel, owner=user)

        self.log_content = log_content = b'Line 1 \xe2\x98\xba\nLine 2 \xe2\x98\xba\nLine 3'

        test_task.logs['test_compressed.log'] = log_content
        test_task.logs.save()
        test_task.logs.gzip_logs()

        test_task.logs['test.log'] = log_content
        test_task.logs.save()
github release-engineering / kobo / tests / test_views.py View on Github external
def setUp(self):
        self._fixture_teardown()
        self.channel1 = Channel.objects.create(name='channel-1')
        self.channel2 = Channel.objects.create(name='channel-2')

        self.client = django.test.Client()
github release-engineering / kobo / tests / test_models.py View on Github external
def test_export(self):
        channel = Channel.objects.create(name='test')
        data = channel.export()
        self.assertTrue(data['id'] > 0)
        self.assertEquals(data['name'], 'test')