import json

from django.test import TestCase

from molo.core.tests.base import MoloTestCaseMixin
from molo.core.api import importers
from molo.core.api.tests import constants


class ArticleImportTestCase(MoloTestCaseMixin, TestCase):

    def setUp(self):
        self.mk_main()

    def test_importer_initializtion(self):
        content = json.dumps(constants.AVAILABLE_ARTICLES)
        importer = importers.ArticlePageImporter(content=content)
import json

from django.test import TestCase

from molo.core.tests.base import MoloTestCaseMixin
from molo.core.api import importers
from molo.core.api.tests import constants


class ArticleImportTestCase(MoloTestCaseMixin, TestCase):

    def setUp(self):
        self.mk_main()

    def test_importer_initializtion(self):
        content = json.dumps(constants.AVAILABLE_ARTICLES)
        importer = importers.ArticlePageImporter(content=content)

        self.assertEqual(importer.articles(), content["items"])
Write test for importer initialisation
Write test for importer initialisation

  import json
  
  from django.test import TestCase
  
  from molo.core.tests.base import MoloTestCaseMixin
  from molo.core.api import importers
  from molo.core.api.tests import constants
  
  
  class ArticleImportTestCase(MoloTestCaseMixin, TestCase):
  
      def setUp(self):
          self.mk_main()
  
      def test_importer_initializtion(self):
          content = json.dumps(constants.AVAILABLE_ARTICLES)
          importer = importers.ArticlePageImporter(content=content)
+ 
+         self.assertEqual(importer.articles(), content["items"])
Write test for importer initialisation
## Code Before:
import json

from django.test import TestCase

from molo.core.tests.base import MoloTestCaseMixin
from molo.core.api import importers
from molo.core.api.tests import constants


class ArticleImportTestCase(MoloTestCaseMixin, TestCase):

    def setUp(self):
        self.mk_main()

    def test_importer_initializtion(self):
        content = json.dumps(constants.AVAILABLE_ARTICLES)
        importer = importers.ArticlePageImporter(content=content)
## Instruction:
Write test for importer initialisation
## Code After:
import json

from django.test import TestCase

from molo.core.tests.base import MoloTestCaseMixin
from molo.core.api import importers
from molo.core.api.tests import constants


class ArticleImportTestCase(MoloTestCaseMixin, TestCase):

    def setUp(self):
        self.mk_main()

    def test_importer_initializtion(self):
        content = json.dumps(constants.AVAILABLE_ARTICLES)
        importer = importers.ArticlePageImporter(content=content)

        self.assertEqual(importer.articles(), content["items"])