'Anonymous user still throwns exception on persistent messages'

def test_message_anonymous_user(self, render_to_string):

    render_to_string.return_value = 'Test'
    class TestNotification(Notification, ):
        name = 'foo'
        subject = 'This    is    {{    foo.id    }}'
        context_object_name = 'foo'
    build = fixture.get(Build)
    user = AnonymousUser()
    req = mock.MagicMock()
    notify = TestNotification(context_object=build, request=req, user=user)
    backend = SiteBackend(request=req)
    self.assertEqual(PersistentMessage.objects.count(), 0)
    with self.assertRaises(NotImplementedError):
        backend.send(notify)
    self.assertEqual(render_to_string.call_count, 1)
    self.assertEqual(PersistentMessage.objects.count(), 0)
