Skip to content

Commit

Permalink
#80 assertFlase is also added and the names are chagned based on pep
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name authored and akorosov committed Mar 30, 2020
1 parent df96fbd commit d217002
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions geospaas/catalog/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,15 @@ def test_empty_short_names(self):

def test_source_uniqueness(self):

p = Platform.objects.get(pk=661) # "short_name": ""
i = Instrument.objects.get(pk=139)# "short_name": ""
source,_ = Source.objects.get_or_create(platform=p, instrument=i)
source2, created = Source.objects.get_or_create(platform=p, instrument=i)
self.assertFalse(created)
plat1 = Platform.objects.get(pk=661) # "short_name": ""
inst1 = Instrument.objects.get(pk=139)# "short_name": ""
source, created1 = Source.objects.get_or_create(platform=plat1, instrument=inst1)
source2, created2 = Source.objects.get_or_create(platform=plat1, instrument=inst1)
self.assertTrue(created1)
self.assertFalse(created2)
self.assertEqual(source2, source)
i2 = Instrument.objects.get(pk=136)# "short_name": "SCATTEROMETERS"
source3,_ = Source.objects.get_or_create(platform=p, instrument=i2)
inst2 = Instrument.objects.get(pk=160)# "short_name": ""
source3,_ = Source.objects.get_or_create(platform=plat1, instrument=inst2)
self.assertNotEqual(source3, source2)


Expand Down

0 comments on commit d217002

Please sign in to comment.