# Path: src/publisher/tests/base.py
# class BaseCase(SimpleBaseCase, DjangoTestCase):
#     pass


import json
from os.path import join
from .base import BaseCase
from publisher import logic, ajson_ingestor, models, utils, relation_logic

        total, latest = logic.latest_article_version_list()
        self.assertEqual(len(latest), self.total_art_count)
        self.assertEqual(len(latest), models.Article.objects.count())

        latest_idx = {obj.article.manuscript_id: obj for obj in latest}
        expected_latest = [
            (353, 1),
            (385, 1),
            (1328, 1),
            (2619, 1),
            (3401, 3),
            (3665, 1),
            (6250, 3),
            (7301, 1),
            (8025, 2),
            (9571, 1),
        ]
        for msid, v in expected_latest:
            # throws a DoesNotExist if expected not in latest resultset
            self.assertEqual(latest_idx[msid].version, v)

    def test_latest_article_version_list_wrapper(self):
        unpublish_these = [(9571, 1)]
        for msid, version in unpublish_these:
            self.unpublish(msid, version)

        wrapper_total, wrapper_results = logic.latest_article_version_list(
            only_published=False
        )

# Path: src/publisher/tests/base.py
# class BaseCase(SimpleBaseCase, DjangoTestCase):
#     pass


# Path: src/publisher/tests/test_logic.py
import json
from os.path import join
from .base import BaseCase
from publisher import logic, ajson_ingestor, models, utils, relation_logic


        total, latest = logic.latest_article_version_list()
        self.assertEqual(len(latest), self.total_art_count)
        self.assertEqual(len(latest), models.Article.objects.count())

        latest_idx = {obj.article.manuscript_id: obj for obj in latest}
        expected_latest = [
            (353, 1),
            (385, 1),
            (1328, 1),
            (2619, 1),
            (3401, 3),
            (3665, 1),
            (6250, 3),
            (7301, 1),
            (8025, 2),
            (9571, 1),
        ]
        for msid, v in expected_latest:
            # throws a DoesNotExist if expected not in latest resultset
            self.assertEqual(latest_idx[msid].version, v)

    def test_latest_article_version_list_wrapper(self):
        unpublish_these = [(9571, 1)]
        for msid, version in unpublish_these:
            self.unpublish(msid, version)

        wrapper_total, wrapper_results = logic.latest_article_version_list(
            only_published=False
        )

        total, results = logic.latest_unpublished_article_versions()