def test_stars_user_delete_event(self): request = RequestFactory().get('/some/page/') user = User.objects.create(username='******') request.user = user event = Event.objects.get(title='Test event') StarredEvent.objects.create( event=event, user=user, ) result = stars(request) eq_(result, {'star_ids': str(event.id)}) event.delete() result = stars(request) eq_(result, {'star_ids': ''})
def test_stars_user_delete_event(self): request = RequestFactory().get('/some/page/') user = User.objects.create( username='******' ) request.user = user event = Event.objects.get(title='Test event') StarredEvent.objects.create( event=event, user=user, ) result = stars(request) eq_(result, {'star_ids': str(event.id)}) event.delete() result = stars(request) eq_(result, {'star_ids': ''})
def test_stars_user_empty(self): request = RequestFactory().get('/some/page/') request.user = User.objects.create( username='******' ) result = stars(request) eq_(result, {'star_ids': ''})
def test_stars_anonymous(self): request = RequestFactory().get('/some/page/') request.user = AnonymousUser() result = stars(request) eq_(result, {})