Code Duplication    Length = 16-16 lines in 2 locations

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

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