"""
These tests ensure someone does not unintentionally change the integer values of enum fields in the database.
"""

from netflix_show_api.db.constants import DURATION_UNITS, TITLE_TYPES, RATINGS, COUNTRIES


MESSAGE = "Constant %r was not as expected and may modify enum fields in the database schema. Please check that you did not accidentally change it."


def test_title_type():
    assert TITLE_TYPES == (
        'movie',
        'tv_show',
    )


def test_duration_unit():
    assert DURATION_UNITS == (
        'minutes',
        'seasons',
    )


def test_ratings():
    assert RATINGS == (
        'G',
        'NC-17',
        'NR',
        'PG',
        'PG-13',
        'R',
        'TV-14',
        'TV-G',
        'TV-MA',
        'TV-PG',
        'TV-Y',
        'TV-Y7',
        'TV-Y7-FV',
        'UR',
    ), MESSAGE % "RATINGS"


def test_countries():
    assert COUNTRIES == (
        'Afghanistan',
        'Albania',
        'Algeria',
        'Angola',
        'Argentina',
        'Armenia',
        'Australia',
        'Austria',
        'Azerbaijan',
        'Bahamas',
        'Bangladesh',
        'Belarus',
        'Belgium',
        'Bermuda',
        'Botswana',
        'Brazil',
        'Bulgaria',
        'Cambodia',
        'Canada',
        'Cayman Islands',
        'Chile',
        'China',
        'Colombia',
        'Croatia',
        'Cuba',
        'Cyprus',
        'Czech Republic',
        'Denmark',
        'Dominican Republic',
        'East Germany',
        'Ecuador',
        'Egypt',
        'Finland',
        'France',
        'Georgia',
        'Germany',
        'Ghana',
        'Greece',
        'Guatemala',
        'Hong Kong',
        'Hungary',
        'Iceland',
        'India',
        'Indonesia',
        'Iran',
        'Iraq',
        'Ireland',
        'Israel',
        'Italy',
        'Jamaica',
        'Japan',
        'Jordan',
        'Kazakhstan',
        'Kenya',
        'Kuwait',
        'Latvia',
        'Lebanon',
        'Liechtenstein',
        'Lithuania',
        'Luxembourg',
        'Malawi',
        'Malaysia',
        'Malta',
        'Mauritius',
        'Mexico',
        'Mongolia',
        'Montenegro',
        'Morocco',
        'Namibia',
        'Nepal',
        'Netherlands',
        'New Zealand',
        'Nicaragua',
        'Nigeria',
        'Norway',
        'Pakistan',
        'Panama',
        'Paraguay',
        'Peru',
        'Philippines',
        'Poland',
        'Portugal',
        'Puerto Rico',
        'Qatar',
        'Romania',
        'Russia',
        'Samoa',
        'Saudi Arabia',
        'Senegal',
        'Serbia',
        'Singapore',
        'Slovakia',
        'Slovenia',
        'Somalia',
        'South Africa',
        'South Korea',
        'Soviet Union',
        'Spain',
        'Sri Lanka',
        'Sudan',
        'Sweden',
        'Switzerland',
        'Syria',
        'Taiwan',
        'Thailand',
        'Turkey',
        'Uganda',
        'Ukraine',
        'United Arab Emirates',
        'United Kingdom',
        'United States',
        'Uruguay',
        'Vatican City',
        'Venezuela',
        'Vietnam',
        'West Germany',
        'Zimbabwe',
    ), MESSAGE % "COUNTRIES"