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): ...@@ -31,7 +31,7 @@ class Importer(models.Model):
def kind(self): def kind(self):
if self.url is None and self.file.name is None: if self.url is None and self.file.name is None:
return None return None
if self.url is '': if self.url is not '' and self.url is not None:
return 'url' return 'url'
else: else:
return 'file' return 'file'
......
...@@ -128,7 +128,7 @@ class ImporterTest(TestCase): ...@@ -128,7 +128,7 @@ class ImporterTest(TestCase):
importer = Importer.objects.create( importer = Importer.objects.create(
name='test importer', name='test importer',
category='repr', category='repr',
campaign = self.campaign, campaign=self.campaign,
) )
self.assertEqual(importer.kind(), None) self.assertEqual(importer.kind(), None)
importer.file = 'a' importer.file = 'a'
...@@ -145,7 +145,7 @@ class ImporterTest(TestCase): ...@@ -145,7 +145,7 @@ class ImporterTest(TestCase):
importer = Importer.objects.create( importer = Importer.objects.create(
name='test importer', name='test importer',
category='repr', category='repr',
campaign = self.campaign, campaign=self.campaign,
file=json_file, file=json_file,
url='' 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