Code Duplication    Length = 16-16 lines in 2 locations

django-data/image/uid/tests/test_models.py 2 locations

@@ 549-564 (lines=16) @@
546
        # set submission
547
        self.submission = self.sample.submission
548
549
    def test_to_biosample(self):
550
        """Testing JSON conversion for biosample submission"""
551
552
        base_dir = os.path.dirname(os.path.abspath(__file__))
553
        file_path = os.path.join(base_dir, "biosample_sample.json")
554
        handle = open(file_path)
555
        reference = json.load(handle)
556
557
        # fix release date to today
558
        now = timezone.now()
559
        reference['releaseDate'] = str(now.date())
560
561
        test = self.sample.to_biosample()
562
563
        self.maxDiff = None
564
        self.assertEqual(reference, test)
565
566
    def test_to_biosample2(self):
567
        """testing json conversion with a biosample_id"""
@@ 363-378 (lines=16) @@
360
        self.animal = Animal.objects.get(pk=1)
361
        self.submission = self.animal.submission
362
363
    def test_to_biosample(self):
364
        """Testing JSON conversion for biosample submission"""
365
366
        base_dir = os.path.dirname(os.path.abspath(__file__))
367
        file_path = os.path.join(base_dir, "biosample_animal.json")
368
        handle = open(file_path)
369
        reference = json.load(handle)
370
371
        # fix release date to today
372
        now = timezone.now()
373
        reference['releaseDate'] = str(now.date())
374
375
        test = self.animal.to_biosample()
376
377
        self.maxDiff = None
378
        self.assertEqual(reference, test)
379
380
    def test_to_biosample2(self):
381
        """testing json conversion with a biosample_id"""