def setUp(self):
        super(ShareGatewayTestCase, self).setUp()
        self.gw = SystemGateway()
        user = self.factory.make_user()
        self.user = self.gw.get_user(user.id, session_id='QWERTY')
        self.sharer = make_storage_user(username='sharer')
        self.othersharee = self.factory.make_user(username='sharee')
        root = StorageObject.objects.get_root(self.sharer._user)
        self.r_node = root.make_subdirectory('NoWrite')
        self.file = self.r_node.make_file('A File for uploads')
        self.rw_node = root.make_subdirectory('WriteMe')
        self.r_share = self.factory.make_share(
            subtree=self.r_node, shared_to=user, name='NoWriteShare',
            access=Share.VIEW)
        self.rw_share = self.factory.make_share(
            subtree=self.rw_node, shared_to=user, name='WriteShare',
            access=Share.MODIFY)
        self.r_share.accept()
        self.rw_share.accept()