Code Duplication    Length = 10-10 lines in 2 locations

omaha_server/omaha/tests/test_api.py 2 locations

@@ 411-420 (lines=10) @@
408
        self.assertEqual(response.status_code, status.HTTP_200_OK)
409
        self.assertDictEqual(StatisticsMonthsSerializer(self.data['hourly']).data, response.data)
410
411
    @freeze_time("2016-03-16")
412
    @is_private()
413
    def test_daily_list(self):
414
        start = datetime(2016, 2, 13, 0)
415
        end = start + timedelta(hours=self.n_hours-1)
416
        response = self.client.get(reverse('api-statistics-live', args=('app',)),
417
                                   dict(start=start.isoformat(), end=end.isoformat()),
418
                                   format='json')
419
        self.assertEqual(response.status_code, status.HTTP_200_OK)
420
        self.assertDictEqual(StatisticsMonthsSerializer(self.data['daily']).data, response.data)
421
422
423
class StatisticsMonthsMixin(object):
@@ 400-409 (lines=10) @@
397
        response = client.get(reverse('api-statistics-live', args=('app',)), format='json')
398
        self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
399
400
    @freeze_time("2016-02-16")
401
    @is_private()
402
    def test_hourly_list(self):
403
        start = datetime(2016, 2, 13, 0)
404
        end = start + timedelta(hours=self.n_hours-1)
405
        response = self.client.get(reverse('api-statistics-live', args=('app',)),
406
                                   dict(start=start.isoformat(), end=end.isoformat()),
407
                                   format='json')
408
        self.assertEqual(response.status_code, status.HTTP_200_OK)
409
        self.assertDictEqual(StatisticsMonthsSerializer(self.data['hourly']).data, response.data)
410
411
    @freeze_time("2016-03-16")
412
    @is_private()