<filename>spendtrackapp/tests/test_models/provide_data_test_entry.py
from datetime import datetime

from spendtrackapp.models import Entry


def entry_change_category_success():
    return [
        [1, 11, [11, 10]],
        [1, 13, [1, 3, 13]],
        [2, 8, [1, 2, 5, 8]],
        [2, 8, [1, 2, 5, 8]],
        [3, 12, [12]],
    ]


def entry_change_category_fail():
    return [
        [1, 1],
        [1, 2],
        [1, 3],
        [1, 5],
        [1, 10],
    ]


def entry_leaf_category():
    return [
        [1, 4],
        [2, 4],
        [3, 7],
        [4, 7],
        [5, 7],
        [6, 8],
        [7, 8],
        [8, 9],
        [9, 11],
        [10, 11],
        [11, 12],
        [12, 12],
    ]


# noinspection PyUnresolvedReferences,PyProtectedMember
def entry_modify_date():
    return [
        [Entry._Entry__modify_start_date, 125, TypeError],
        [Entry._Entry__modify_start_date, 12.5, TypeError],
        [Entry._Entry__modify_start_date, True, TypeError],
        [Entry._Entry__modify_start_date, [], TypeError],
        [Entry._Entry__modify_start_date, '', ValueError],
        [Entry._Entry__modify_start_date, '2018 05 15', ValueError],
        [Entry._Entry__modify_start_date, '2018-05-15 15:15:15', ValueError],
        [Entry._Entry__modify_start_date, '2018-55-15', ValueError],
        [Entry._Entry__modify_start_date, '2018-05-99', ValueError],

        [Entry._Entry__modify_end_date, 125, TypeError],
        [Entry._Entry__modify_end_date, 12.5, TypeError],
        [Entry._Entry__modify_end_date, True, TypeError],
        [Entry._Entry__modify_end_date, [], TypeError],
        [Entry._Entry__modify_end_date, '', ValueError],
        [Entry._Entry__modify_end_date, '2018 05 15', ValueError],
        [Entry._Entry__modify_end_date, '2018-05-15 15:15:15', ValueError],
        [Entry._Entry__modify_end_date, '2018-55-15', ValueError],
        [Entry._Entry__modify_end_date, '2018-05-99', ValueError],
    ]


def entry_find_by_date_range():
    return [
        [1, None, None,
         [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],

        [1, datetime(2000, 1, 1), datetime(2020, 1, 1),
         [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],
        [1, '2000-1-1', '2020-1-1',
         [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],

        [1, None, datetime(2015, 11, 6), [19, 7, 14, 16]],
        [1, None, '2015-11-6', [19, 7, 14, 16]],
        [1, None, datetime(2017, 7, 1), [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2]],
        [1, None, '2017-7-1', [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2]],
        [1, datetime(2000, 1, 1), datetime(2017, 7, 1),
         [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2]],
        [1, '2000-1-1', '2017-7-1', [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2]],

        [1, datetime(2017, 8, 1), None, [1, 20, 18, 10, 8, 13, 26]],
        [1, '2017-8-1', None, [1, 20, 18, 10, 8, 13, 26]],
        [1, datetime(2017, 2, 6), None, [17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],
        [1, '2017-2-6', None, [17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],
        [1, datetime(2017, 2, 6), datetime(2020, 1, 1), [17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],
        [1, '2017-2-6', '2020-1-1', [17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],

        [1, datetime(2016, 1, 12), datetime(2017, 8, 11), [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],
        [1, '2016-1-12', '2017-8-11', [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],
        [1, datetime(2016, 1, 13), datetime(2017, 8, 11), [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],
        [1, '2016-1-13', '2017-8-11', [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],
        [1, datetime(2016, 1, 12), datetime(2017, 8, 10), [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],
        [1, '2016-1-12', '2017-8-10', [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],

        [1, datetime(2017, 12, 25), datetime(2018, 12, 31), []],
        [1, '2017-12-25', '2018-12-31', []],

        [2, '2018-12-01', '2018-12-31', [27, 28]]
    ]


def entry_find_by_year():
    return [
        [1, 1000, []],
        [1, 2013, []],
        [1, 2014, [19, 7]],
        [1, 2015, [14, 16, 5, 21]],
        [1, 2016, [11, 4, 15, 3, 6]],
        [1, 2017, [22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10]],
        [1, 2018, []],
        [1, 2019, [8, 13, 26]],
        [1, 2020, []],
        [1, 9999, []],

        [2, 2018, [27, 28]],
        [2, 2019, []]
    ]


def entry_find_by_month():
    return [
        [1, 2014, 12, [19, 7]],
        [1, 2015, 11, [16, 5, 21]],
        [1, 2016, 1, [11, 4]],
        [1, 2016, 1, [11, 4]],
        [1, 2017, 10, [20, 18]],
        [1, 2019, 2, [13]],

        [1, 2019, 4, []],
        [1, 2017, 4, []],
        [1, 2000, 4, []],

        [1, 1000, 1, []],
        [1, 9999, 12, []],

        [2, 2018, 5, []],
        [2, 2018, 12, [27, 28]],
    ]


def entry_find_by_week():
    return [
        [1, 2014, 51, [19]],
        [1, 2014, 52, [7]],
        [1, 2015, 41, [14]],
        [1, 2015, 45, [16, 5, 21]],
        [1, 2016, 2, [11]],
        [1, 2016, 4, [4]],
        [1, 2016, 12, [15]],
        [1, 2016, 27, [3]],
        [1, 2016, 34, [6]],
        [1, 2017, 6, [17]],
        [1, 2017, 10, [9]],
        [1, 2017, 24, [12]],
        [1, 2017, 26, [2]],
        [1, 2017, 32, [1]],
        [1, 2017, 40, [20]],
        [1, 2017, 41, [18]],
        [1, 2017, 51, [10]],
        [1, 2019, 1, [8]],
        [1, 2019, 9, [13]],

        [1, 2019, 52, []],
        [1, 2020, 1, [26]],

        [1, 2015, 1, []],
        [1, 2019, 2, []],

        [1, 1000, 1, []],
        [1, 9999, 52, []],

        [2, 2018, 49, [27]],
        [2, 2018, 50, [28]]
    ]


def entry_total_by_date_range():
    return [
        [1, None, None, 189],

        [1, datetime(2000, 1, 1), datetime(2020, 1, 1), 189],
        [1, '2000-1-1', '2020-1-1', 189],

        [1, None, datetime(2015, 11, 6), 176],
        [1, None, '2015-11-6', 176],
        [1, None, datetime(2017, 7, 1), 93.5],
        [1, None, '2017-7-1', 93.5],
        [1, datetime(2000, 1, 1), datetime(2017, 7, 1), 93.5],
        [1, '2000-1-1', '2017-7-1', 93.5],

        [1, datetime(2017, 8, 1), None, 95.5],
        [1, '2017-8-1', None, 95.5],
        [1, datetime(2017, 2, 6), None, 33],
        [1, '2017-2-6', None, 33],
        [1, datetime(2017, 2, 6), datetime(2020, 1, 1), 33],
        [1, '2017-2-6', '2020-1-1', 33],

        [1, datetime(2016, 1, 12), datetime(2017, 8, 11), -21.5],
        [1, '2016-1-12', '2017-8-11', -21.5],
        [1, datetime(2016, 1, 13), datetime(2017, 8, 11), -21.5],
        [1, '2016-1-13', '2017-8-11', -21.5],
        [1, datetime(2016, 1, 12), datetime(2017, 8, 10), -21.5],
        [1, '2016-1-12', '2017-8-10', -21.5],

        [1, datetime(2017, 12, 25), datetime(2018, 12, 31), 0],
        [1, '2017-12-25', '2018-12-31', 0],

        [2, '2018-12-01', '2018-12-31', 20]
    ]


def entry_total_by_year():
    return [
        [1, 1000, 0],
        [1, 2013, 0],
        [1, 2014, 76.5],
        [1, 2015, 88.5],
        [1, 2016, -28.5],
        [1, 2017, 12.5],
        [1, 2018, 0],
        [1, 2019, 40],
        [1, 2020, 0],
        [1, 9999, 0],
        [2, 2018, 20],
        [2, 2019, 0]
    ]


def entry_total_by_month():
    return [
        [1, 2014, 12, 75 + 1.5],
        [1, 2015, 11, 100 - 8.5 - 2.5],
        [1, 2016, 1, -8.5 - 1.5],
        [1, 2017, 1, -1.5 - 1.5 + 25 - 2.5],
        [1, 2017, 10, -12.5 - 2.5],
        [1, 2019, 2, 50],

        [1, 2019, 4, 0],
        [1, 2017, 4, 0],
        [1, 2000, 4, 0],

        [1, 1000, 1, 0],
        [1, 9999, 12, 0],

        [2, 2018, 5, 0],
        [2, 2018, 12, 20],
    ]


def entry_total_by_week():
    return [
        [1, 2014, 51, 75],
        [1, 2014, 52, 1.5],
        [1, 2015, 41, -0.5],
        [1, 2015, 45, 89],

        [1, 2019, 52, 0],
        [1, 2020, 1, -5],

        [1, 2015, 1, 0],
        [1, 2019, 2, 0],

        [1, 1000, 1, 0],
        [1, 9999, 52, 0],

        [2, 2018, 49, 5],
        [2, 2018, 50, 15]
    ]


def entry_find_by_date_range_with_category():
    return [
        [1, None, None, 4, [14, 2, 1]],
        [1, '2018-12-29', '2019-12-31', 2, []],
        [1, '2017-12-25', '2018-12-31', 1, []],
        [1, '2016-1-12', '2017-8-11', 7, [4, 3]],
        [2, '2018-12-1', '2019-12-31', 10, [27]],
        [2, '2018-12-1', '2019-12-31', 12, [28]],
    ]


def entry_find_by_year_with_category():
    return [
        [1, 1000, 9, []],
        [1, 2013, 2, []],
        [1, 2014, 10, [19]],
        [1, 2016, 5, [4, 15, 3, 6]],
        [1, 2017, 1, [2, 1]],
        [1, 2017, 100, []],
        [1, 2018, 2, []],
        [1, 2020, 2, []],
        [1, 9999, 2, []],
        [2, 2018, 1, []],
        [2, 2018, 11, [27]]
    ]


def entry_find_by_month_with_category():
    return [
        [1, 2014, 12, 1, [7]],
        [1, 2015, 11, 1, [16, 5]],
        [1, 2016, 1, 5, [4]],
        [1, 2016, 1, 99, []],

        [1, 2019, 4, 1, []],
        [1, 2017, 4, 1, []],
        [1, 2000, 4, 1, []],

        [1, 1000, 1, 1, []],
        [1, 9999, 12, 1, []],

        [2, 2018, 12, 10, [27]],
        [2, 2018, 12, 11, [27]],
        [2, 2018, 12, 12, [28]],
    ]


def entry_find_by_week_with_category():
    return [
        [1, 2015, 45, 1, [16, 5]],
        [1, 2015, 45, 5, [16, 5]],
        [1, 2015, 45, 7, [5]],
        [1, 2015, 45, 2, []],
        [1, 2015, 45, 99, []],

        [1, 2019, 52, 12, []],
        [1, 2020, 1, 12, [26]],

        [1, 2015, 1, 1, []],
        [1, 2019, 2, 1, []],

        [1, 1000, 1, 1, []],
        [1, 9999, 52, 1, []],

        [2, 2018, 49, 12, []],
        [2, 2018, 49, 11, [27]],
        [2, 2018, 50, 12, [28]],
        [2, 2018, 50, 11, []],
        [2, 2018, 50, 10, []],
    ]


def entry_find_by_date_range_with_limit():
    return [
        [1, None, None, -1,
         [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],
        [1, None, None, 27,
         [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],
        [1, None, None, 26,
         [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],
        [1, None, None, 5, [19, 7, 14, 16, 5]],
        [1, None, None, 1, [19]],
        [1, None, None, 0, []],

        [1, '2016-1-12', '2017-8-11', -1, [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],
        [1, '2016-1-12', '2017-8-11', 15, [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],
        [1, '2016-1-12', '2017-8-11', 14, [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],
        [1, '2016-1-12', '2017-8-11', 5, [11, 4, 15, 3, 6]],
        [1, '2016-1-12', '2017-8-11', 1, [11]],
        [1, '2016-1-12', '2017-8-11', 0, []],

        [1, '2017-12-25', '2018-12-31', -1, []],
        [1, '2017-12-25', '2018-12-31', 5, []],

        [2, '2018-12-1', '2018-12-31', 1, [27]],
        [2, '2018-12-1', '2018-12-31', 5, [27, 28]],
    ]


def entry_find_by_year_with_limit():
    return [
        [1, 2013, -1, []],
        [1, 2013, 5, []],

        [1, 2014, -1, [19, 7]],
        [1, 2014, 3, [19, 7]],
        [1, 2014, 2, [19, 7]],
        [1, 2014, 1, [19]],
        [1, 2014, 0, []],

        [1, 2017, -1, [22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10]],
        [1, 2017, 13, [22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10]],
        [1, 2017, 12, [22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10]],
        [1, 2017, 5, [22, 23, 24, 25, 17]],
        [1, 2017, 2, [22, 23]],
        [1, 2017, 1, [22]],
        [1, 2017, 0, []],

        [1, 2018, -1, []],
        [1, 2018, 5, []],

        [2, 2018, 1, [27]],
        [2, 2018, 5, [27, 28]],
    ]


def entry_find_by_month_with_limit():
    return [
        [1, 2015, 11, -1, [16, 5, 21]],
        [1, 2015, 11, 4, [16, 5, 21]],
        [1, 2015, 11, 3, [16, 5, 21]],
        [1, 2015, 11, 2, [16, 5]],
        [1, 2015, 11, 1, [16]],
        [1, 2015, 11, 0, []],

        [1, 9999, 12, -1, []],
        [1, 9999, 12, 5, []],

        [2, 2018, 12, 1, [27]],
        [2, 2018, 12, 5, [27, 28]],
    ]


def entry_find_by_week_with_limit():
    return [
        [1, 2015, 45, -1, [16, 5, 21]],
        [1, 2015, 45, 4, [16, 5, 21]],
        [1, 2015, 45, 3, [16, 5, 21]],
        [1, 2015, 45, 1, [16]],
        [1, 2015, 45, 0, []],

        [1, 2019, 52, -1, []],
        [1, 2019, 52, 5, []],

        [1, 2020, 1, -1, [26]],
        [1, 2020, 1, 2, [26]],
        [1, 2020, 1, 1, [26]],
        [1, 2020, 1, 0, []],
    ]

<filename>spendtrackapp/tests/test_models/provide_data_test_entry.py
from datetime import datetime

from spendtrackapp.models import Entry


def entry_change_category_success():
    return [
        [1, 11, [11, 10]],
        [1, 13, [1, 3, 13]],
        [2, 8, [1, 2, 5, 8]],
        [2, 8, [1, 2, 5, 8]],
        [3, 12, [12]],
    ]


def entry_change_category_fail():
    return [
        [1, 1],
        [1, 2],
        [1, 3],
        [1, 5],
        [1, 10],
    ]


def entry_leaf_category():
    return [
        [1, 4],
        [2, 4],
        [3, 7],
        [4, 7],
        [5, 7],
        [6, 8],
        [7, 8],
        [8, 9],
        [9, 11],
        [10, 11],
        [11, 12],
        [12, 12],
    ]


# noinspection PyUnresolvedReferences,PyProtectedMember
def entry_modify_date():
    return [
        [Entry._Entry__modify_start_date, 125, TypeError],
        [Entry._Entry__modify_start_date, 12.5, TypeError],
        [Entry._Entry__modify_start_date, True, TypeError],
        [Entry._Entry__modify_start_date, [], TypeError],
        [Entry._Entry__modify_start_date, '', ValueError],
        [Entry._Entry__modify_start_date, '2018 05 15', ValueError],
        [Entry._Entry__modify_start_date, '2018-05-15 15:15:15', ValueError],
        [Entry._Entry__modify_start_date, '2018-55-15', ValueError],
        [Entry._Entry__modify_start_date, '2018-05-99', ValueError],

        [Entry._Entry__modify_end_date, 125, TypeError],
        [Entry._Entry__modify_end_date, 12.5, TypeError],
        [Entry._Entry__modify_end_date, True, TypeError],
        [Entry._Entry__modify_end_date, [], TypeError],
        [Entry._Entry__modify_end_date, '', ValueError],
        [Entry._Entry__modify_end_date, '2018 05 15', ValueError],
        [Entry._Entry__modify_end_date, '2018-05-15 15:15:15', ValueError],
        [Entry._Entry__modify_end_date, '2018-55-15', ValueError],
        [Entry._Entry__modify_end_date, '2018-05-99', ValueError],
    ]


def entry_find_by_date_range():
    return [
        [1, None, None,
         [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],

        [1, datetime(2000, 1, 1), datetime(2020, 1, 1),
         [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],
        [1, '2000-1-1', '2020-1-1',
         [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],

        [1, None, datetime(2015, 11, 6), [19, 7, 14, 16]],
        [1, None, '2015-11-6', [19, 7, 14, 16]],
        [1, None, datetime(2017, 7, 1), [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2]],
        [1, None, '2017-7-1', [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2]],
        [1, datetime(2000, 1, 1), datetime(2017, 7, 1),
         [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2]],
        [1, '2000-1-1', '2017-7-1', [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2]],

        [1, datetime(2017, 8, 1), None, [1, 20, 18, 10, 8, 13, 26]],
        [1, '2017-8-1', None, [1, 20, 18, 10, 8, 13, 26]],
        [1, datetime(2017, 2, 6), None, [17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],
        [1, '2017-2-6', None, [17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],
        [1, datetime(2017, 2, 6), datetime(2020, 1, 1), [17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],
        [1, '2017-2-6', '2020-1-1', [17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],

        [1, datetime(2016, 1, 12), datetime(2017, 8, 11), [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],
        [1, '2016-1-12', '2017-8-11', [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],
        [1, datetime(2016, 1, 13), datetime(2017, 8, 11), [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],
        [1, '2016-1-13', '2017-8-11', [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],
        [1, datetime(2016, 1, 12), datetime(2017, 8, 10), [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],
        [1, '2016-1-12', '2017-8-10', [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],

        [1, datetime(2017, 12, 25), datetime(2018, 12, 31), []],
        [1, '2017-12-25', '2018-12-31', []],

        [2, '2018-12-01', '2018-12-31', [27, 28]]
    ]


def entry_find_by_year():
    return [
        [1, 1000, []],
        [1, 2013, []],
        [1, 2014, [19, 7]],
        [1, 2015, [14, 16, 5, 21]],
        [1, 2016, [11, 4, 15, 3, 6]],
        [1, 2017, [22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10]],
        [1, 2018, []],
        [1, 2019, [8, 13, 26]],
        [1, 2020, []],
        [1, 9999, []],

        [2, 2018, [27, 28]],
        [2, 2019, []]
    ]


def entry_find_by_month():
    return [
        [1, 2014, 12, [19, 7]],
        [1, 2015, 11, [16, 5, 21]],
        [1, 2016, 1, [11, 4]],
        [1, 2016, 1, [11, 4]],
        [1, 2017, 10, [20, 18]],
        [1, 2019, 2, [13]],

        [1, 2019, 4, []],
        [1, 2017, 4, []],
        [1, 2000, 4, []],

        [1, 1000, 1, []],
        [1, 9999, 12, []],

        [2, 2018, 5, []],
        [2, 2018, 12, [27, 28]],
    ]


def entry_find_by_week():
    return [
        [1, 2014, 51, [19]],
        [1, 2014, 52, [7]],
        [1, 2015, 41, [14]],
        [1, 2015, 45, [16, 5, 21]],
        [1, 2016, 2, [11]],
        [1, 2016, 4, [4]],
        [1, 2016, 12, [15]],
        [1, 2016, 27, [3]],
        [1, 2016, 34, [6]],
        [1, 2017, 6, [17]],
        [1, 2017, 10, [9]],
        [1, 2017, 24, [12]],
        [1, 2017, 26, [2]],
        [1, 2017, 32, [1]],
        [1, 2017, 40, [20]],
        [1, 2017, 41, [18]],
        [1, 2017, 51, [10]],
        [1, 2019, 1, [8]],
        [1, 2019, 9, [13]],

        [1, 2019, 52, []],
        [1, 2020, 1, [26]],

        [1, 2015, 1, []],
        [1, 2019, 2, []],

        [1, 1000, 1, []],
        [1, 9999, 52, []],

        [2, 2018, 49, [27]],
        [2, 2018, 50, [28]]
    ]


def entry_total_by_date_range():
    return [
        [1, None, None, 189],

        [1, datetime(2000, 1, 1), datetime(2020, 1, 1), 189],
        [1, '2000-1-1', '2020-1-1', 189],

        [1, None, datetime(2015, 11, 6), 176],
        [1, None, '2015-11-6', 176],
        [1, None, datetime(2017, 7, 1), 93.5],
        [1, None, '2017-7-1', 93.5],
        [1, datetime(2000, 1, 1), datetime(2017, 7, 1), 93.5],
        [1, '2000-1-1', '2017-7-1', 93.5],

        [1, datetime(2017, 8, 1), None, 95.5],
        [1, '2017-8-1', None, 95.5],
        [1, datetime(2017, 2, 6), None, 33],
        [1, '2017-2-6', None, 33],
        [1, datetime(2017, 2, 6), datetime(2020, 1, 1), 33],
        [1, '2017-2-6', '2020-1-1', 33],

        [1, datetime(2016, 1, 12), datetime(2017, 8, 11), -21.5],
        [1, '2016-1-12', '2017-8-11', -21.5],
        [1, datetime(2016, 1, 13), datetime(2017, 8, 11), -21.5],
        [1, '2016-1-13', '2017-8-11', -21.5],
        [1, datetime(2016, 1, 12), datetime(2017, 8, 10), -21.5],
        [1, '2016-1-12', '2017-8-10', -21.5],

        [1, datetime(2017, 12, 25), datetime(2018, 12, 31), 0],
        [1, '2017-12-25', '2018-12-31', 0],

        [2, '2018-12-01', '2018-12-31', 20]
    ]


def entry_total_by_year():
    return [
        [1, 1000, 0],
        [1, 2013, 0],
        [1, 2014, 76.5],
        [1, 2015, 88.5],
        [1, 2016, -28.5],
        [1, 2017, 12.5],
        [1, 2018, 0],
        [1, 2019, 40],
        [1, 2020, 0],
        [1, 9999, 0],
        [2, 2018, 20],
        [2, 2019, 0]
    ]


def entry_total_by_month():
    return [
        [1, 2014, 12, 75 + 1.5],
        [1, 2015, 11, 100 - 8.5 - 2.5],
        [1, 2016, 1, -8.5 - 1.5],
        [1, 2017, 1, -1.5 - 1.5 + 25 - 2.5],
        [1, 2017, 10, -12.5 - 2.5],
        [1, 2019, 2, 50],

        [1, 2019, 4, 0],
        [1, 2017, 4, 0],
        [1, 2000, 4, 0],

        [1, 1000, 1, 0],
        [1, 9999, 12, 0],

        [2, 2018, 5, 0],
        [2, 2018, 12, 20],
    ]


def entry_total_by_week():
    return [
        [1, 2014, 51, 75],
        [1, 2014, 52, 1.5],
        [1, 2015, 41, -0.5],
        [1, 2015, 45, 89],

        [1, 2019, 52, 0],
        [1, 2020, 1, -5],

        [1, 2015, 1, 0],
        [1, 2019, 2, 0],

        [1, 1000, 1, 0],
        [1, 9999, 52, 0],

        [2, 2018, 49, 5],
        [2, 2018, 50, 15]
    ]


def entry_find_by_date_range_with_category():
    return [
        [1, None, None, 4, [14, 2, 1]],
        [1, '2018-12-29', '2019-12-31', 2, []],
        [1, '2017-12-25', '2018-12-31', 1, []],
        [1, '2016-1-12', '2017-8-11', 7, [4, 3]],
        [2, '2018-12-1', '2019-12-31', 10, [27]],
        [2, '2018-12-1', '2019-12-31', 12, [28]],
    ]


def entry_find_by_year_with_category():
    return [
        [1, 1000, 9, []],
        [1, 2013, 2, []],
        [1, 2014, 10, [19]],
        [1, 2016, 5, [4, 15, 3, 6]],
        [1, 2017, 1, [2, 1]],
        [1, 2017, 100, []],
        [1, 2018, 2, []],
        [1, 2020, 2, []],
        [1, 9999, 2, []],
        [2, 2018, 1, []],
        [2, 2018, 11, [27]]
    ]


def entry_find_by_month_with_category():
    return [
        [1, 2014, 12, 1, [7]],
        [1, 2015, 11, 1, [16, 5]],
        [1, 2016, 1, 5, [4]],
        [1, 2016, 1, 99, []],

        [1, 2019, 4, 1, []],
        [1, 2017, 4, 1, []],
        [1, 2000, 4, 1, []],

        [1, 1000, 1, 1, []],
        [1, 9999, 12, 1, []],

        [2, 2018, 12, 10, [27]],
        [2, 2018, 12, 11, [27]],
        [2, 2018, 12, 12, [28]],
    ]


def entry_find_by_week_with_category():
    return [
        [1, 2015, 45, 1, [16, 5]],
        [1, 2015, 45, 5, [16, 5]],
        [1, 2015, 45, 7, [5]],
        [1, 2015, 45, 2, []],
        [1, 2015, 45, 99, []],

        [1, 2019, 52, 12, []],
        [1, 2020, 1, 12, [26]],

        [1, 2015, 1, 1, []],
        [1, 2019, 2, 1, []],

        [1, 1000, 1, 1, []],
        [1, 9999, 52, 1, []],

        [2, 2018, 49, 12, []],
        [2, 2018, 49, 11, [27]],
        [2, 2018, 50, 12, [28]],
        [2, 2018, 50, 11, []],
        [2, 2018, 50, 10, []],
    ]


def entry_find_by_date_range_with_limit():
    return [
        [1, None, None, -1,
         [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],
        [1, None, None, 27,
         [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],
        [1, None, None, 26,
         [19, 7, 14, 16, 5, 21, 11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10, 8, 13, 26]],
        [1, None, None, 5, [19, 7, 14, 16, 5]],
        [1, None, None, 1, [19]],
        [1, None, None, 0, []],

        [1, '2016-1-12', '2017-8-11', -1, [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],
        [1, '2016-1-12', '2017-8-11', 15, [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],
        [1, '2016-1-12', '2017-8-11', 14, [11, 4, 15, 3, 6, 22, 23, 24, 25, 17, 9, 12, 2, 1]],
        [1, '2016-1-12', '2017-8-11', 5, [11, 4, 15, 3, 6]],
        [1, '2016-1-12', '2017-8-11', 1, [11]],
        [1, '2016-1-12', '2017-8-11', 0, []],

        [1, '2017-12-25', '2018-12-31', -1, []],
        [1, '2017-12-25', '2018-12-31', 5, []],

        [2, '2018-12-1', '2018-12-31', 1, [27]],
        [2, '2018-12-1', '2018-12-31', 5, [27, 28]],
    ]


def entry_find_by_year_with_limit():
    return [
        [1, 2013, -1, []],
        [1, 2013, 5, []],

        [1, 2014, -1, [19, 7]],
        [1, 2014, 3, [19, 7]],
        [1, 2014, 2, [19, 7]],
        [1, 2014, 1, [19]],
        [1, 2014, 0, []],

        [1, 2017, -1, [22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10]],
        [1, 2017, 13, [22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10]],
        [1, 2017, 12, [22, 23, 24, 25, 17, 9, 12, 2, 1, 20, 18, 10]],
        [1, 2017, 5, [22, 23, 24, 25, 17]],
        [1, 2017, 2, [22, 23]],
        [1, 2017, 1, [22]],
        [1, 2017, 0, []],

        [1, 2018, -1, []],
        [1, 2018, 5, []],

        [2, 2018, 1, [27]],
        [2, 2018, 5, [27, 28]],
    ]


def entry_find_by_month_with_limit():
    return [
        [1, 2015, 11, -1, [16, 5, 21]],
        [1, 2015, 11, 4, [16, 5, 21]],
        [1, 2015, 11, 3, [16, 5, 21]],
        [1, 2015, 11, 2, [16, 5]],
        [1, 2015, 11, 1, [16]],
        [1, 2015, 11, 0, []],

        [1, 9999, 12, -1, []],
        [1, 9999, 12, 5, []],

        [2, 2018, 12, 1, [27]],
        [2, 2018, 12, 5, [27, 28]],
    ]


def entry_find_by_week_with_limit():
    return [
        [1, 2015, 45, -1, [16, 5, 21]],
        [1, 2015, 45, 4, [16, 5, 21]],
        [1, 2015, 45, 3, [16, 5, 21]],
        [1, 2015, 45, 1, [16]],
        [1, 2015, 45, 0, []],

        [1, 2019, 52, -1, []],
        [1, 2019, 52, 5, []],

        [1, 2020, 1, -1, [26]],
        [1, 2020, 1, 2, [26]],
        [1, 2020, 1, 1, [26]],
        [1, 2020, 1, 0, []],
    ]

# noinspection PyUnresolvedReferences,PyProtectedMember