Commit e4250010 authored by okhin's avatar okhin 🚴

Still this kind thing

parent ff1ca8d2
Pipeline #1194 passed with stages
in 1 minute and 48 seconds
......@@ -31,7 +31,7 @@ class Importer(models.Model):
def kind(self):
if self.url is None and self.file.name is None:
return None
if self.url is '':
if self.url is not '' and self.url is not None:
return 'url'
else:
return 'file'
......
......@@ -128,7 +128,7 @@ class ImporterTest(TestCase):
importer = Importer.objects.create(
name='test importer',
category='repr',
campaign = self.campaign,
campaign=self.campaign,
)
self.assertEqual(importer.kind(), None)
importer.file = 'a'
......@@ -145,7 +145,7 @@ class ImporterTest(TestCase):
importer = Importer.objects.create(
name='test importer',
category='repr',
campaign = self.campaign,
campaign=self.campaign,
file=json_file,
url=''
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment