<s> from django . db import IntegrityError <EOL> from recurrence import Recurrence <EOL> from tests . models import EventWithNulls , EventWithNoNulls <EOL> import pytest <EOL> @ pytest . mark . django_db <EOL> def test_recurs_can_be_explicitly_none_if_none_is_allowed ( ) : <EOL> event = EventWithNulls . objects . create ( recurs = None ) <EOL> assert event . recurs is None <EOL> reloaded = EventWithNulls . objects . get ( pk = event . pk ) <EOL> assert reloaded . recurs is None <EOL> @ pytest . mark . django_db <EOL> def test_recurs_cannot_be_explicitly_none_if_none_is_disallowed ( ) : <EOL> with pytest . raises ( IntegrityError ) : <EOL> EventWithNoNulls . objects . create ( recurs = None ) <EOL> @ pytest . mark . django_db <EOL> def test_recurs_can_be_empty_even_if_none_is_disallowed ( ) : <EOL> event = EventWithNoNulls . objects . create ( recurs = Recurrence ( ) ) <EOL> assert event . recurs == Recurrence ( ) </s>
