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


from functools import partial
from os.path import join
from datetime import date, datetime, timedelta
from .base import BaseCase
from publisher import ajson_ingestor, models, utils, codes, fragment_logic
from publisher.ajson_ingestor import StateError
from publisher.utils import lmap
from unittest import skip
from unittest.mock import patch
from publisher import logic
from django.test import Client, override_settings
from django.urls import reverse
import json, copy
        ajson_ingestor.ingest(self.ajson)

        self.assertEqual(models.Journal.objects.count(), 1)
        self.assertEqual(models.Article.objects.count(), 1)
        self.assertEqual(models.ArticleVersion.objects.count(), 1)

    def test_article_ingest_data(self):
        ajson_ingestor.ingest(self.ajson)
        article_cases = [
            ("journal", logic.journal()),
            ("manuscript_id", 20105),
            ("volume", 5),
            ("doi", "10.7554/eLife.20105"),
            ("date_received", date(year=2016, month=7, day=27)),
            ("date_accepted", date(year=2016, month=10, day=3)),
        ]
        art = models.Article.objects.get(manuscript_id=20105)
        for attr, expected in article_cases:
            actual = getattr(art, attr)
            self.assertEqual(
                actual,
                expected,
                "expecting %r for %r got %r" % (expected, attr, actual),
            )

        article_version_cases = [
            ("article", art),
            (
                "title",
                "An electrostatic selection mechanism controls sequential kinase signaling downstream of the T cell receptor",

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


# Path: src/publisher/tests/test_ajson_ingest.py
from functools import partial
from os.path import join
from datetime import date, datetime, timedelta
from .base import BaseCase
from publisher import ajson_ingestor, models, utils, codes, fragment_logic
from publisher.ajson_ingestor import StateError
from publisher.utils import lmap
from unittest import skip
from unittest.mock import patch
from publisher import logic
from django.test import Client, override_settings
from django.urls import reverse
import json, copy

        ajson_ingestor.ingest(self.ajson)

        self.assertEqual(models.Journal.objects.count(), 1)
        self.assertEqual(models.Article.objects.count(), 1)
        self.assertEqual(models.ArticleVersion.objects.count(), 1)

    def test_article_ingest_data(self):
        ajson_ingestor.ingest(self.ajson)
        article_cases = [
            ("journal", logic.journal()),
            ("manuscript_id", 20105),
            ("volume", 5),
            ("doi", "10.7554/eLife.20105"),
            ("date_received", date(year=2016, month=7, day=27)),
            ("date_accepted", date(year=2016, month=10, day=3)),
        ]
        art = models.Article.objects.get(manuscript_id=20105)
        for attr, expected in article_cases:
            actual = getattr(art, attr)
            self.assertEqual(
                actual,
                expected,
                "expecting %r for %r got %r" % (expected, attr, actual),
            )

        article_version_cases = [
            ("article", art),
            (
                "title",
                "An electrostatic selection mechanism controls sequential kinase signaling downstream of the T cell receptor",

            ),