Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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()
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()
def test_export(self):
channel = Channel.objects.create(name='test')
data = channel.export()
self.assertTrue(data['id'] > 0)
self.assertEquals(data['name'], 'test')