def test_get_share_generation(self):
        """Test the get_share_generation method."""
        user1 = self.factory.make_user(username='sharer')
        root = StorageObject.objects.get_root(user1)
        share = self.factory.make_share(
            subtree=root, shared_to=self.user._user, name='Share')
        share = self.gw.get_share(share.id, accepted_only=False)
        self.assertEqual(0, self.gw.get_share_generation(share))
        # increase the generation
        user1.root_node.make_subdirectory('a dir')
        # check we get the correct generation
        self.assertEqual(1, self.gw.get_share_generation(share))