def test_store_record_coauthors_with_none_deleted(self):
        from invenio.bibrank_selfcites_indexer import store_record_coauthors
        from invenio.bibrank_selfcites_indexer import get_authors_from_record
        from invenio.bibrank_selfcites_indexer import get_authors_tags
        from invenio.dbquery import run_sql
        tags = get_authors_tags()
        recid = 1
        config = {'friends_threshold': 3}
        authors = get_authors_from_record(recid, tags)

        sql = 'DELETE FROM rnkEXTENDEDAUTHORS WHERE id = %s'
        run_sql(sql, (recid, ))
        store_record_coauthors(recid, authors, [], authors, config)
        sql = 'SELECT count(*) FROM rnkEXTENDEDAUTHORS WHERE id = %s'
        count = run_sql(sql, (recid, ))[0][0]
        self.assert_(count)
    def test_store_record_coauthors_with_none_deleted(self):
        from invenio.bibrank_selfcites_indexer import store_record_coauthors
        from invenio.bibrank_selfcites_indexer import get_authors_from_record
        from invenio.bibrank_selfcites_indexer import get_authors_tags
        from invenio.dbquery import run_sql
        tags = get_authors_tags()
        recid = 1
        config = {'friends_threshold': 3}
        authors = get_authors_from_record(recid, tags)

        sql = 'DELETE FROM rnkEXTENDEDAUTHORS WHERE id = %s'
        run_sql(sql, (recid,))
        store_record_coauthors(recid, authors, [], authors, config)
        sql = 'SELECT count(*) FROM rnkEXTENDEDAUTHORS WHERE id = %s'
        count = run_sql(sql, (recid,))[0][0]
        self.assert_(count)