from django.test import TestCase
from django_snooze import apis


class APITestCase(TestCase):
    def setUp(self):
        """Sets up an API object to play with.

        :returns: None

        """
        self.api = apis.api
        self.api.discover_models()

    def test_apps(self):
        """Test if the right apps are present.

        :returns: None

        """
        self.assertIn('tests', self.api._resources.keys())
        self.assertIn('auth', self.api._resources.keys())

from django.test import TestCase
from django_snooze import apis


class APITestCase(TestCase):
    def setUp(self):
        """Sets up an API object to play with.

        :returns: None

        """
        self.api = apis.api
        self.api.discover_models()

    def test_apps(self):
        """Test if the right apps are present.

        :returns: None

        """
        self.assertIn('tests', self.api._resources.keys())
        self.assertIn('auth', self.api._resources.keys())
        tests_models = [x.model_name for x in self.api._resources['tests']]
        self.assertNotIn('abstract', tests_models)

Test to see if abstract classes sneak in.
Test to see if abstract classes sneak in.

Now that get_models has been found to skip abstract classes, we want to test
for this in case this behaviour ever changes.

  from django.test import TestCase
  from django_snooze import apis
  
  
  class APITestCase(TestCase):
      def setUp(self):
          """Sets up an API object to play with.
  
          :returns: None
  
          """
          self.api = apis.api
          self.api.discover_models()
  
      def test_apps(self):
          """Test if the right apps are present.
  
          :returns: None
  
          """
          self.assertIn('tests', self.api._resources.keys())
          self.assertIn('auth', self.api._resources.keys())
+         tests_models = [x.model_name for x in self.api._resources['tests']]
+         self.assertNotIn('abstract', tests_models)
  
Test to see if abstract classes sneak in.
## Code Before:
from django.test import TestCase
from django_snooze import apis


class APITestCase(TestCase):
    def setUp(self):
        """Sets up an API object to play with.

        :returns: None

        """
        self.api = apis.api
        self.api.discover_models()

    def test_apps(self):
        """Test if the right apps are present.

        :returns: None

        """
        self.assertIn('tests', self.api._resources.keys())
        self.assertIn('auth', self.api._resources.keys())

## Instruction:
Test to see if abstract classes sneak in.
## Code After:
from django.test import TestCase
from django_snooze import apis


class APITestCase(TestCase):
    def setUp(self):
        """Sets up an API object to play with.

        :returns: None

        """
        self.api = apis.api
        self.api.discover_models()

    def test_apps(self):
        """Test if the right apps are present.

        :returns: None

        """
        self.assertIn('tests', self.api._resources.keys())
        self.assertIn('auth', self.api._resources.keys())
        tests_models = [x.model_name for x in self.api._resources['tests']]
        self.assertNotIn('abstract', tests_models)
