Skip to content

Commit

Permalink
Add tests for empty location and description
Browse files Browse the repository at this point in the history
  • Loading branch information
pfertyk authored and Paweł Fertyk committed Sep 9, 2016
1 parent 79441c9 commit a7a4871
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/event_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,22 @@ def test_update_simple():
assert normalize_component(event.raw) == normalize_component(event_updated.raw)


def test_update_empty_location():
event_orig = Event.fromString(_get_text('event_dt_simple'), **EVENT_KWARGS)
event = Event.fromString(_get_text('event_dt_simple'), **EVENT_KWARGS)
event.update_location('')
assert normalize_component(event_orig.raw) ==\
normalize_component(event.raw), "Empty location should not be saved"


def test_update_empty_description():
event_orig = Event.fromString(_get_text('event_dt_simple'), **EVENT_KWARGS)
event = Event.fromString(_get_text('event_dt_simple'), **EVENT_KWARGS)
event.update_description('')
assert normalize_component(event_orig.raw) ==\
normalize_component(event.raw), "Empty description should not be saved"


def test_update_remove_categories():
event = Event.fromString(_get_text('event_dt_simple_updated'), **EVENT_KWARGS)
event_nocat = Event.fromString(_get_text('event_dt_simple_nocat'), **EVENT_KWARGS)
Expand Down

0 comments on commit a7a4871

Please sign in to comment.