'Test the unloading of the preview community'

@deferred(timeout=10)
def test_unload_preview(self):

    def verify_unloaded(_):
        self.assertEqual(len(self.dispersy.get_communities()), 1)
    preview_member = DummyMember(self.dispersy, 2, ('c' * 20))
    preview_community = PreviewChannelCommunity(self.dispersy, preview_member, self.member)
    preview_community.initialize()
    preview_community.init_timestamp = (-500)
    self.dispersy._communities[('c' * 20)] = preview_community
    return self.community.unload_preview().addCallback(verify_unloaded)
