def setup_function(): Account.clear_cache() Comment.clear_cache() Location.clear_cache() Media.clear_cache() Story.clear_cache() Tag.clear_cache()
def test_clear_cache_comment(id): account = Account("test") media = Media("test") comment = Comment(id, media=media, owner=account, text="test", created_at=0) assert Comment.cache == {id: comment} Comment.clear_cache() assert Comment.cache == dict() assert Media.cache == {"test": media} assert Account.cache == {"test": account}
def test_comment(login, password, shortcode): agent = AgentAccount(login, password) media = Media(shortcode) comment = agent.add_comment(media, "test") agent.delete_comment(comment) Account.clear_cache() Media.clear_cache() Comment.clear_cache()
def test_clear_cache_comment(): account = Account("test") media = Media("test") comment = Comment(1488, media=media, owner=account, text="test", created_at=0) Media.clear_cache() Comment.clear_cache() assert(Comment._cache == dict()) assert(Media._cache == dict())