Ejemplo n.º 1
0
def test_get_major_changes_added(patched_series_class):
    new = SeriesRevision(changeset=NO_DB_CHANGESET,
                         series=None,
                         country=COUNTRY_TWO,
                         language=LANGUAGE_TWO,
                         publisher=PUBLISHER_TWO,
                         is_comics_publication=True,
                         is_current=True,
                         is_singleton=False)
    c = new._get_major_changes()
    assert c == {
        'publisher changed': True,
        'country changed': True,
        'language changed': True,
        'is_comics_publication changed': True,
        'is_singleton changed': True,
        'is_current changed': True,
        'to is_comics_publication': True,
        'from is_comics_publication': False,
        'to is_singleton': False,
        'from is_singleton': False,
        'to is_current': True,
        'from is_current': False,
        'old publisher': None,
        'new publisher': PUBLISHER_TWO,
        'old country': None,
        'new country': COUNTRY_TWO,
        'old language': None,
        'new language': LANGUAGE_TWO,
    }
def test_get_major_changes_added(patched_series_class):
    new = SeriesRevision(changeset=NO_DB_CHANGESET,
                         series=None,
                         country=COUNTRY_TWO,
                         language=LANGUAGE_TWO,
                         publisher=PUBLISHER_TWO,
                         is_comics_publication=True,
                         is_current=True,
                         is_singleton=False)
    c = new._get_major_changes()
    assert c == {
        'publisher changed': True,
        'country changed': True,
        'language changed': True,
        'is_comics_publication changed': True,
        'is_singleton changed': True,
        'is_current changed': True,
        'to is_comics_publication': True,
        'from is_comics_publication': False,
        'to is_singleton': False,
        'from is_singleton': False,
        'to is_current': True,
        'from is_current': False,
        'old publisher': None,
        'new publisher': PUBLISHER_TWO,
        'old country': None,
        'new country': COUNTRY_TWO,
        'old language': None,
        'new language': LANGUAGE_TWO,
    }
Ejemplo n.º 3
0
def test_get_major_changes_deleted(patched_series_class):
    old = Series(country=COUNTRY_ONE,
                 language=LANGUAGE_ONE,
                 publisher=PUBLISHER_ONE,
                 is_comics_publication=True,
                 is_current=True,
                 is_singleton=False)
    new = SeriesRevision(changeset=NO_DB_CHANGESET,
                         series=old,
                         country=COUNTRY_ONE,
                         language=LANGUAGE_ONE,
                         publisher=PUBLISHER_ONE,
                         is_comics_publication=True,
                         is_current=True,
                         is_singleton=False,
                         previous_revision=SeriesRevision(),
                         deleted=True)

    c = new._get_major_changes()
    assert c == {
        'publisher changed': True,
        'country changed': True,
        'language changed': True,
        'is_comics_publication changed': True,
        'is_singleton changed': True,
        'is_current changed': True,
        'to is_comics_publication': False,
        'from is_comics_publication': True,
        'to is_singleton': False,
        'from is_singleton': False,
        'to is_current': False,
        'from is_current': True,
        'old publisher': PUBLISHER_ONE,
        'new publisher': None,
        'old country': COUNTRY_ONE,
        'new country': None,
        'old language': LANGUAGE_ONE,
        'new language': None,
    }
def test_get_major_changes_deleted(patched_series_class):
    old = Series(country=COUNTRY_ONE,
                 language=LANGUAGE_ONE,
                 publisher=PUBLISHER_ONE,
                 is_comics_publication=True,
                 is_current=True,
                 is_singleton=False)
    new = SeriesRevision(changeset=NO_DB_CHANGESET,
                         series=old,
                         country=COUNTRY_ONE,
                         language=LANGUAGE_ONE,
                         publisher=PUBLISHER_ONE,
                         is_comics_publication=True,
                         is_current=True,
                         is_singleton=False,
                         previous_revision=SeriesRevision(),
                         deleted=True)

    c = new._get_major_changes()
    assert c == {
        'publisher changed': True,
        'country changed': True,
        'language changed': True,
        'is_comics_publication changed': True,
        'is_singleton changed': True,
        'is_current changed': True,
        'to is_comics_publication': False,
        'from is_comics_publication': True,
        'to is_singleton': False,
        'from is_singleton': False,
        'to is_current': False,
        'from is_current': True,
        'old publisher': PUBLISHER_ONE,
        'new publisher': None,
        'old country': COUNTRY_ONE,
        'new country': None,
        'old language': LANGUAGE_ONE,
        'new language': None,
    }