<s> from django . core . urlresolvers import reverse <EOL> from . . models import Event , Host , Tag <EOL> from . base import TestBase <EOL> class TestLandingPage ( TestBase ) : <EOL> "<STR_LIT>" <EOL> def setUp ( self ) : <EOL> self . _setUpEvents ( ) <EOL> self . _setUpUsersAndLogin ( ) <EOL> def test_has_upcoming_events ( self ) : <EOL> """<STR_LIT>""" <EOL> response = self . client . get ( reverse ( '<STR_LIT>' ) ) <EOL> events = response . context [ '<STR_LIT>' ] <EOL> assert all ( [ ( '<STR_LIT>' in e . slug or '<STR_LIT>' in e . slug ) <EOL> for e in events ] ) <EOL> def test_no_inactive_events_on_dashboard ( self ) : <EOL> """<STR_LIT>""" <EOL> stalled_tag = Tag . objects . get ( name = '<STR_LIT>' ) <EOL> stalled = Event . objects . create ( <EOL> slug = '<STR_LIT>' , host = Host . objects . first ( ) , <EOL> ) <EOL> stalled . tags . add ( stalled_tag ) <EOL> completed = Event . objects . create ( slug = '<STR_LIT>' , <EOL> completed = True , <EOL> host = Host . objects . first ( ) ) <EOL> self . assertIn ( stalled , Event . objects . unpublished_events ( ) ) <EOL> self . assertIn ( completed , Event . objects . unpublished_events ( ) ) <EOL> response = self . client . get ( reverse ( '<STR_LIT>' ) ) <EOL> self . assertNotIn ( stalled , response . context [ '<STR_LIT>' ] ) <EOL> self . assertNotIn ( completed , response . context [ '<STR_LIT>' ] ) </s>
