Example #1
0
def test_get_district_report_of_specific_day():
    # Arrange
    report = DistrictReportOfDay(
        district_name='Kurnool',
        mandals=[
            MandalReportOfDay(mandal_id=1,
                              mandal_name='Kallur',
                              total_cases=5,
                              total_deaths=4,
                              total_recovered_cases=2),
            MandalReportOfDay(mandal_id=2,
                              mandal_name='Adoni',
                              total_cases=0,
                              total_deaths=0,
                              total_recovered_cases=0),
            MandalReportOfDay(mandal_id=3,
                              mandal_name='Kodumur',
                              total_cases=0,
                              total_deaths=0,
                              total_recovered_cases=0)
        ],
        total_cases=5,
        total_deaths=4,
        total_recovered_cases=2)
    expected_response = {
        'district_name':
        'Kurnool',
        'mandals': [{
            'mandal_id': 1,
            'mandal_name': 'Kallur',
            'total_cases': 5,
            'total_deaths': 4,
            'total_recovered_cases': 2
        }, {
            'mandal_id': 2,
            'mandal_name': 'Adoni',
            'total_cases': 0,
            'total_deaths': 0,
            'total_recovered_cases': 0
        }, {
            'mandal_id': 3,
            'mandal_name': 'Kodumur',
            'total_cases': 0,
            'total_deaths': 0,
            'total_recovered_cases': 0
        }],
        'total_cases':
        5,
        'total_deaths':
        4,
        'total_recovered_cases':
        2
    }
    presenter = PresenterImplementation()

    # Act
    response = presenter.get_response_district_report_of_specific_day(report)

    # Arrange
    assert response == expected_response
Example #2
0
def test_get_district_daily_cumulative_report_response_presenter():
    # Arrange
    presenter = PresenterImplementation()
    expected_result = {
        'state_name':
        'Andhrapradesh',
        'districts': [{
            'district_id':
            1,
            'district_name':
            'Kurnool',
            'daily_cumulative': [{
                'date':
                str(datetime.date(2020, 5, 26).strftime('%d-%b-%Y')),
                'total_cases':
                40,
                'total_deaths':
                3,
                'total_recovered_cases':
                37,
                'active_cases':
                0
            }],
        }, {
            'district_id':
            2,
            'district_name':
            'Nellore',
            'daily_cumulative': [{
                'date':
                str(datetime.date(2020, 5, 26).strftime('%d-%b-%Y')),
                'total_cases':
                30,
                'total_deaths':
                3,
                'total_recovered_cases':
                27,
                'active_cases':
                0
            }, {
                'date':
                str(datetime.date(2020, 5, 27).strftime('%d-%b-%Y')),
                'total_cases':
                40,
                'total_deaths':
                3,
                'total_recovered_cases':
                37,
                'active_cases':
                0
            }],
        }],
    }

    # Act
    result = presenter.get_district_daily_cumulative_report_response(
        list_district_daily_cumulative)

    # Assert
    assert result == expected_result
Example #3
0
def test_get_response_for_get_report_of_state_of_a_date():
    # Arrange
    presenter = PresenterImplementation()
    expected_result = {
        'state_name':
        'Andrapradesh',
        'districts': [{
            'district_id': 1,
            'district_name': 'Kadapa',
            'total_cases': 0,
            'total_recovered_cases': 0,
            'total_deaths': 0
        }, {
            'district_id': 2,
            'district_name': 'Kurnool',
            'total_cases': 24,
            'total_recovered_cases': 4,
            'total_deaths': 12
        }],
        'total_cases':
        24,
        'total_recovered_cases':
        4,
        'total_deaths':
        12
    }
    report = StateReportForADate(
        state_name='Andrapradesh',
        districts=[
            DistrictReportForADate(district_id=1,
                                   district_name='Kadapa',
                                   total_cases=0,
                                   total_recovered_cases=0,
                                   total_deaths=0),
            DistrictReportForADate(district_id=2,
                                   district_name='Kurnool',
                                   total_cases=24,
                                   total_recovered_cases=4,
                                   total_deaths=12)
        ],
        total_cases=24,
        total_recovered_cases=4,
        total_deaths=12)
    # Act
    result = presenter.get_response_for_report_of_state_for_date(report)

    # Assert
    assert result == expected_result
Example #4
0
def api_wrapper(*args, **kwargs):
    # ---------MOCK IMPLEMENTATION---------

    user = kwargs['user']
    request_data = kwargs['request_data']
    mandal_id = request_data['mandal_id']
    date = request_data['date']
    total_confirmed = request_data['total_confirmed']
    total_deaths = request_data['total_deaths']
    total_recovered = request_data['total_recovered']

    storage = MandalStorageImplementation()
    presenter = PresenterImplementation()

    interactor = UpdateStatistics(storage=storage, presenter=presenter)
    try:
        interactor.update_statistics(mandal_id=mandal_id,
                                     user=user,
                                     date=date,
                                     total_confirmed=total_confirmed,
                                     total_deaths=total_deaths,
                                     total_recovered=total_recovered)
    except InvalidMandalId:
        raise NotFound(*INVALID_MANDAL_ID)
    except InvalidDetailsForTotalConfirmed:
        raise BadRequest(*INVALID_TOTAL_CONFIRMED)
    except InvalidDetailsForTotalDeaths:
        raise BadRequest(*INVALID_TOTAL_DEATHS)
    except InvalidDetailsForTotalRecovered:
        raise BadRequest(*INVALID_TOTAL_RECOVERED)
    except StatNotFound:
        raise BadRequest(*DETAILS_NOT_FOUND)
    except UserNotAdmin:
        raise Forbidden(*USER_NOT_ADMIN)
    return HttpResponse(status=200)
Example #5
0
def api_wrapper(*args, **kwargs):
    # ---------MOCK IMPLEMENTATION---------

    storage = StateStorageImplementation()
    presenter = PresenterImplementation()

    interactor = GetDailyCumulativeReport(storage=storage, presenter=presenter)
    daily_cumulative_report = interactor.get_daily_cumulative_report()
    data = json.dumps(daily_cumulative_report)
    return HttpResponse(data, status=200)
def api_wrapper(*args, **kwargs):
    # ---------MOCK IMPLEMENTATION---------

    storage = StateStorageImplementation()
    presenter = PresenterImplementation()
    interactor = GetStateWiseDailyCasesReport(storage=storage,
                                              presenter=presenter)

    response = interactor.get_state_wise_daily_cases_report()
    data = json.dumps(response)
    return HttpResponse(data, status=200)
def test_get_response_for_state_wise_cumulative_report():
    # Arrange
    presenter = PresenterImplementation()
    expected_result = {
        "state_name":
        "Andhrapradesh",
        # "state_id":1,
        #   "date":datetime.date(year=2020, month=5, day=28),
        "districts": [{
            "district_id": 1,
            "district_name": "Kurnool",
            "total_cases": 10,
            "total_deaths": 0,
            "total_recovered_cases": 10,
            "active_cases": 0
        }, {
            "district_id": 2,
            "district_name": "Nellore",
            "total_cases": 10,
            "total_deaths": 0,
            "total_recovered_cases": 10,
            "active_cases": 0
        }],
        "total_cases":
        20,
        "total_deaths":
        0,
        "total_recovered_cases":
        20,
        "active_cases":
        0
    }

    # Act
    result = presenter.get_response_for_state_wise_cumulative_report(
        cumulative_state_report_dto)

    # Assert
    assert result == expected_result
def test_get_daily_cumulative_report_response_presenter():
    # Arrange
    presenter = PresenterImplementation()
    expected_result = {
        "daily_cumulative":[
            {
                "date": str(datetime.date(year=2020, month=5, day=28)\
                    .strftime('%d-%b-%Y')),
                "total_cases":20,
                "total_deaths":0,
                "total_recovered_cases":20,
                'active_cases':0
            }
        ]
    }

    # Act
    result = presenter.get_daily_cumulative_report_response(
        daily_cumulative_report_dto)

    # Assert
    assert result == expected_result
Example #9
0
def api_wrapper(*args, **kwargs):
    # ---------MOCK IMPLEMENTATION---------

    storage = StateStorageImplementation()
    presenter = PresenterImplementation()
    interactor = GetReportOFStateForDate(storage=storage, presenter=presenter)

    request_data = kwargs['request_data']
    query = kwargs['request_query_params']
    date = query['date']
    try:
        response = interactor.get_report_of_state_for_date(date=date)
    except InvalidDate:
        raise NotFound(*INVALID_DATE)
    data = json.dumps(response)
    return HttpResponse(data, status=200)
Example #10
0
def api_wrapper(*args, **kwargs):
    # ---------MOCK IMPLEMENTATION---------

    mandal_id = kwargs['mandal_id']
    user = kwargs['user']
    storage = MandalStorageImplementation()
    presenter = PresenterImplementation()

    interactor = GetStatistics(storage=storage, presenter=presenter)
    try:
        response = interactor.get_statistics(mandal_id=mandal_id, user=user)
    except UserNotAdmin:
        raise Forbidden(*USER_NOT_ADMIN)
    except InvalidMandalId:
        raise NotFound(*INVALID_MANDAL_ID)
    data = json.dumps(response)
    return HttpResponse(data, status=200)
def api_wrapper(*args, **kwargs):
    # ---------MOCK IMPLEMENTATION---------

    storage = DistrictStorageImplementation()
    presenter = PresenterImplementation()
    interactor = GetDayWiseMandalDetails(storage=storage, presenter=presenter)

    request_data = kwargs['request_data']
    district_id = kwargs['district_id']
    try:
        response = interactor.get_day_wise_mandal_details(
            district_id=district_id)
    except InvalidDistrictId:
        raise NotFound(*INVALID_DISTRICT_ID)

    data = json.dumps(response)
    response = HttpResponse(data, status=200)
    return response
def api_wrapper(*args, **kwargs):
    # ---------MOCK IMPLEMENTATION---------

    # till_date = kwargs['till_date']
    query = kwargs['request_query_params']
    till_date = query['till_date']
    storage = StateStorageImplementation()
    presenter = PresenterImplementation()
    try:
        interactor = GetStateWiseCumulativeReport(storage=storage,
                                                  presenter=presenter)
    except InvalidDate:
        raise BadRequest(*INVALID_DATE)

    daily_cumulative_report = interactor.get_state_wise_cumulative_report(
        till_date)
    data = json.dumps(daily_cumulative_report)
    return HttpResponse(data, status=200)
def api_wrapper(*args, **kwargs):
    # ---------MOCK IMPLEMENTATION---------

    storage = DistrictStorageImplementation()
    presenter = PresenterImplementation()
    interactor = GetDailyCumulativeReportOfMandalsForDistrict(
        storage=storage, presenter=presenter)

    request_data = kwargs['request_data']
    district_id = kwargs['district_id']
    try:
        response = interactor.get_daily_cumulative_report_of_mandals_for_district(
            district_id=district_id)
    except InvalidDistrictId:
        raise NotFound(*INVALID_DISTRICT_ID)

    data = json.dumps(response)
    response = HttpResponse(data, status=200)
    return response
def api_wrapper(*args, **kwargs):
    # ---------MOCK IMPLEMENTATION---------

    storage = DistrictStorageImplementation()
    presenter = PresenterImplementation()
    interactor = GetDistrictCumulativeReport(storage=storage,
                                             presenter=presenter)

    request_data = kwargs['request_data']
    district_id = kwargs['district_id']
    query = kwargs['request_query_params']
    till_date = query['till_date']
    try:
        response = interactor.get_district_cumulative_report(
            till_date=till_date, district_id=district_id)
    except InvalidDistrictId:
        raise NotFound(*INVALID_DISTRICT_ID)
    data = json.dumps(response)
    return HttpResponse(data, status=200)
def api_wrapper(*args, **kwargs):
    # ---------MOCK IMPLEMENTATION---------

    request_data = kwargs['request_data']
    username = request_data['username']
    password = request_data['password']

    storage = UserStorageImplementation()
    presenter = PresenterImplementation()
    oauth_storage = OAuth2SQLStorage()

    interactor = LoginUserInteractor(storage=storage,
                                     presenter=presenter,
                                     oauth_storage=oauth_storage)

    try:
        access_token_response = interactor.login_user(username=username,
                                                      password=password)
    except InvalidUserName:
        raise NotFound(*INVALID_USERNAME)
    except InvalidPassword:
        raise NotFound(*INVALID_PASSWORD)
    data = json.dumps(access_token_response)
    return HttpResponse(data, 200)
Example #16
0
def test_get_response_for_daily_cumulative_report_of_mandals_for_district():
    # Arrange
    import datetime
    mandals = [
        MandalCumulativeReportOnSpecificDayDto(
            mandal_id=1,
            mandal_name="Kallur",
            report=[
                CumulativeReportOnSpecificDay(date=datetime.date(year=2020,
                                                                 month=5,
                                                                 day=26),
                                              total_cases=5,
                                              total_recovered_cases=3,
                                              total_deaths=0,
                                              active_cases=2),
                CumulativeReportOnSpecificDay(date=datetime.date(year=2020,
                                                                 month=5,
                                                                 day=27),
                                              total_cases=10,
                                              total_recovered_cases=5,
                                              total_deaths=3,
                                              active_cases=2)
            ]),
        MandalCumulativeReportOnSpecificDayDto(
            mandal_id=2,
            mandal_name="Adoni",
            report=[
                CumulativeReportOnSpecificDay(date=datetime.date(year=2020,
                                                                 month=5,
                                                                 day=30),
                                              total_cases=0,
                                              total_recovered_cases=0,
                                              total_deaths=0,
                                              active_cases=0),
                CumulativeReportOnSpecificDay(date=datetime.date(year=2020,
                                                                 month=5,
                                                                 day=31),
                                              total_cases=5,
                                              total_recovered_cases=1,
                                              total_deaths=2,
                                              active_cases=2)
            ])
    ]
    report = ListMandalDailyCumulativeReportDto(district_name="Kurnool",
                                                mandals=mandals)
    expected_response = {
        'district_name':
        'Kurnool',
        'mandals': [{
            'mandal_id':
            1,
            'mandal_name':
            'Kallur',
            'daily_cumulative': [{
                'date':
                str(datetime.date(2020, 5, 26).strftime('%d-%b-%Y')),
                'total_cases':
                5,
                'total_deaths':
                0,
                'total_recovered_cases':
                3,
                'active_cases':
                2
            }, {
                'date':
                str(datetime.date(2020, 5, 27).strftime('%d-%b-%Y')),
                'total_cases':
                10,
                'total_deaths':
                3,
                'total_recovered_cases':
                5,
                'active_cases':
                2
            }]
        }, {
            'mandal_id':
            2,
            'mandal_name':
            'Adoni',
            'daily_cumulative': [{
                'date':
                str(datetime.date(2020, 5, 30).strftime('%d-%b-%Y')),
                'total_cases':
                0,
                'total_deaths':
                0,
                'total_recovered_cases':
                0,
                'active_cases':
                0
            }, {
                'date':
                str(datetime.date(2020, 5, 31).strftime('%d-%b-%Y')),
                'total_cases':
                5,
                'total_deaths':
                2,
                'total_recovered_cases':
                1,
                'active_cases':
                2
            }]
        }]
    }
    presenter = PresenterImplementation()

    # Act
    response = presenter.\
        get_response_for_daily_cumulative_report_of_mandals_for_district(report)

    # Assert
    assert response == expected_response
def test_get_district_cumulative_report_presenter():
    # Arrange
    report = DistrictReportDto(
        # district_id=2,
        district_name='Nellore',
        mandals=[
            MandalReportDto(mandal_id=4,
                            mandal_name='Kota',
                            total_cases=0,
                            total_deaths=0,
                            total_recovered_cases=0,
                            active_cases=0),
            MandalReportDto(mandal_id=5,
                            mandal_name='Kavali',
                            total_cases=0,
                            total_deaths=0,
                            total_recovered_cases=0,
                            active_cases=0),
            MandalReportDto(mandal_id=6,
                            mandal_name='Kovuru',
                            total_cases=40,
                            total_deaths=0,
                            total_recovered_cases=20,
                            active_cases=20)
        ],
        total_cases=40,
        total_deaths=0,
        total_recovered_cases=20,
        active_cases=20)

    presenter = PresenterImplementation()
    expected_result = {
        # 'district_id': 2,
        'district_name':
        'Nellore',
        'mandals': [{
            'mandal_id': 4,
            'mandal_name': 'Kota',
            'total_cases': 0,
            'total_recovered_cases': 0,
            'total_deaths': 0,
            'active_cases': 0
        }, {
            'mandal_id': 5,
            'mandal_name': 'Kavali',
            'total_cases': 0,
            'total_recovered_cases': 0,
            'total_deaths': 0,
            'active_cases': 0
        }, {
            'mandal_id': 6,
            'mandal_name': 'Kovuru',
            'total_cases': 40,
            'total_recovered_cases': 20,
            'total_deaths': 0,
            'active_cases': 20
        }],
        'total_cases':
        40,
        'total_recovered_cases':
        20,
        'total_deaths':
        0,
        'active_cases':
        20
    }

    # Act
    result = presenter.get_response_for_district_cumulative_report(report)

    # Assert
    assert result == expected_result
Example #18
0
def test_get_response_for_get_state_wise_daily_report_presenter_when_no_report_for_a_day(
):
    # Arrange
    presenter = PresenterImplementation()
    report = [
        Report(date=datetime.date(2020, 5, 22),
               total_cases=5,
               total_recovered_cases=2,
               total_deaths=1,
               active_cases=2),
        Report(date=datetime.date(2020, 5, 23),
               total_cases=10,
               total_recovered_cases=2,
               total_deaths=3,
               active_cases=5),
        Report(date=datetime.date(2020, 5, 24),
               total_cases=12,
               total_recovered_cases=2,
               total_deaths=4,
               active_cases=6),
        Report(date=datetime.date(2020, 5, 25),
               total_cases=0,
               total_recovered_cases=0,
               total_deaths=0,
               active_cases=0),
        Report(date=datetime.date(2020, 5, 26),
               total_cases=0,
               total_recovered_cases=0,
               total_deaths=0,
               active_cases=0),
        Report(date=datetime.date(2020, 5, 27),
               total_cases=0,
               total_recovered_cases=0,
               total_deaths=0,
               active_cases=0),
        Report(date=datetime.date(2020, 5, 28),
               total_cases=0,
               total_recovered_cases=0,
               total_deaths=0,
               active_cases=0),
        Report(date=datetime.date(2020, 5, 29),
               total_cases=0,
               total_recovered_cases=0,
               total_deaths=0,
               active_cases=0)
    ]
    expected_response = [{
        'date':
        str(datetime.date(2020, 5, 22).strftime('%d-%b-%Y')),
        'total_cases':
        5,
        'total_deaths':
        1,
        'total_recovered_cases':
        2,
        'active_cases':
        2
    }, {
        'date':
        str(datetime.date(2020, 5, 23).strftime('%d-%b-%Y')),
        'total_cases':
        10,
        'total_deaths':
        3,
        'total_recovered_cases':
        2,
        'active_cases':
        5
    }, {
        'date':
        str(datetime.date(2020, 5, 24).strftime('%d-%b-%Y')),
        'total_cases':
        12,
        'total_deaths':
        4,
        'total_recovered_cases':
        2,
        'active_cases':
        6
    }, {
        'date':
        str(datetime.date(2020, 5, 25).strftime('%d-%b-%Y')),
        'total_cases':
        0,
        'total_deaths':
        0,
        'total_recovered_cases':
        0,
        'active_cases':
        0
    }, {
        'date':
        str(datetime.date(2020, 5, 26).strftime('%d-%b-%Y')),
        'total_cases':
        0,
        'total_deaths':
        0,
        'total_recovered_cases':
        0,
        'active_cases':
        0
    }, {
        'date':
        str(datetime.date(2020, 5, 27).strftime('%d-%b-%Y')),
        'total_cases':
        0,
        'total_deaths':
        0,
        'total_recovered_cases':
        0,
        'active_cases':
        0
    }, {
        'date':
        str(datetime.date(2020, 5, 28).strftime('%d-%b-%Y')),
        'total_cases':
        0,
        'total_deaths':
        0,
        'total_recovered_cases':
        0,
        'active_cases':
        0
    }, {
        'date':
        str(datetime.date(2020, 5, 29).strftime('%d-%b-%Y')),
        'total_cases':
        0,
        'total_deaths':
        0,
        'total_recovered_cases':
        0,
        'active_cases':
        0
    }]

    # Act
    response = presenter.get_response_for_state_wise_daily_cases_report(report)

    # Assert
    assert response == expected_response
Example #19
0
def test_get_response_for_get_state_wise_daily_report_presenter():
    # Arrange
    presenter = PresenterImplementation()
    report = [
        Report(date=datetime.date(2020, 5, 20),
               total_cases=5,
               total_recovered_cases=5,
               total_deaths=0,
               active_cases=0),
        Report(date=datetime.date(2020, 5, 21),
               total_cases=20,
               total_recovered_cases=10,
               total_deaths=0,
               active_cases=10),
        Report(date=datetime.date(2020, 5, 22),
               total_cases=16,
               total_recovered_cases=10,
               total_deaths=3,
               active_cases=3),
        Report(date=datetime.date(2020, 5, 23),
               total_cases=27,
               total_recovered_cases=8,
               total_deaths=5,
               active_cases=14),
        Report(date=datetime.date(2020, 5, 24),
               total_cases=29,
               total_recovered_cases=4,
               total_deaths=19,
               active_cases=6)
    ]
    expected_response = [{
        'active_cases':
        0,
        'date':
        str(datetime.date(2020, 5, 20).strftime('%d-%b-%Y')),
        'total_cases':
        5,
        'total_deaths':
        0,
        'total_recovered_cases':
        5
    }, {
        'active_cases':
        10,
        'date':
        str(datetime.date(2020, 5, 21).strftime('%d-%b-%Y')),
        'total_cases':
        20,
        'total_deaths':
        0,
        'total_recovered_cases':
        10
    }, {
        'active_cases':
        3,
        'date':
        str(datetime.date(2020, 5, 22).strftime('%d-%b-%Y')),
        'total_cases':
        16,
        'total_deaths':
        3,
        'total_recovered_cases':
        10
    }, {
        'active_cases':
        14,
        'date':
        str(datetime.date(2020, 5, 23).strftime('%d-%b-%Y')),
        'total_cases':
        27,
        'total_deaths':
        5,
        'total_recovered_cases':
        8
    }, {
        'active_cases':
        6,
        'date':
        str(datetime.date(2020, 5, 24).strftime('%d-%b-%Y')),
        'total_cases':
        29,
        'total_deaths':
        19,
        'total_recovered_cases':
        4
    }]

    # Act
    response = presenter.get_response_for_state_wise_daily_cases_report(report)

    # Assert
    assert response == expected_response
Example #20
0
def test_get_statistics_presenter():
    # Arrange
    import datetime
    presenter = PresenterImplementation()
    mandal_report = MandalStatistics(
        mandal_id=1,
        mandal_name='Kallur',
        reports=[
            Statistics(date=datetime.date(2020, 5, 22),
                       total_cases=5,
                       total_deaths=1,
                       total_recovered_cases=2),
            Statistics(date=datetime.date(2020, 5, 23),
                       total_cases=6,
                       total_deaths=1,
                       total_recovered_cases=2),
            Statistics(date=datetime.date(2020, 5, 24),
                       total_cases=5,
                       total_deaths=4,
                       total_recovered_cases=2)
        ])
    expected_response = {
        'mandal_id':
        1,
        'mandal_name':
        'Kallur',
        'reports': [{
            'date':
            str(datetime.date(2020, 5, 22).strftime('%d-%b-%Y')),
            'total_cases':
            5,
            'total_deaths':
            1,
            'total_recovered_cases':
            2
        }, {
            'date':
            str(datetime.date(2020, 5, 23).strftime('%d-%b-%Y')),
            'total_cases':
            6,
            'total_deaths':
            1,
            'total_recovered_cases':
            2
        }, {
            'date':
            str(datetime.date(2020, 5, 24).strftime('%d-%b-%Y')),
            'total_cases':
            5,
            'total_deaths':
            4,
            'total_recovered_cases':
            2
        }]
    }

    # Act
    response = presenter.get_response_for_get_statistics(mandal_report)

    # Assert
    assert response == expected_response
def test_get_daily_cumulative_report_for_district():
    # Arrange
    presenter = PresenterImplementation()
    reports = DailyCumulativeReport(
        report = [
            CumulativeReportOnSpecificDay(
                date=datetime.date(2020, 5, 22),
                total_cases=6,
                total_deaths=3,
                total_recovered_cases=5,
                active_cases=-2
            ),
            CumulativeReportOnSpecificDay(
                date=datetime.date(2020, 5, 23),
                total_cases=28,
                total_deaths=8,
                total_recovered_cases=13,
                active_cases=7
            ),
            CumulativeReportOnSpecificDay(
                date=datetime.date(2020, 5, 24),
                total_cases=57,
                total_deaths=27,
                total_recovered_cases=17,
                active_cases=13
            ),
            CumulativeReportOnSpecificDay(
                date=datetime.date(2020, 5, 25),
                total_cases=87,
                total_deaths=32,
                total_recovered_cases=27,
                active_cases=28
            )
        ]
    )
    expected_response ={
        'daily_cumulative':[
            {
                'date': str(datetime.date(2020, 5, 22).strftime('%d-%b-%Y')),
                'total_cases': 6,
                'total_deaths': 3,
                'total_recovered_cases': 5,
                'active_cases': -2
            },
            {
                'date': str(datetime.date(2020, 5, 23).strftime('%d-%b-%Y')),
                'total_cases': 28,
                'total_deaths': 8,
                'total_recovered_cases': 13,
                'active_cases': 7
            },
            {
                'date': str(datetime.date(2020, 5, 24).strftime('%d-%b-%Y')),
                'total_cases': 57,
                'total_deaths': 27,
                'total_recovered_cases': 17,
                'active_cases': 13
            },
            {
                'date': str(datetime.date(2020, 5, 25).strftime('%d-%b-%Y')),
                'total_cases': 87,
                'total_deaths': 32,
                'total_recovered_cases': 27,
                'active_cases': 28
            }
        ]
    }
    
    # Act
    response = presenter.get_response_for_daily_cumulative_report_for_district(
        reports)

    # Assert
    assert response == expected_response