# Path: yak/settings.py
# def perform_import(val, setting_name):
#     def __getattr__(self, attr):
# class YAKAPISettings(APISettings):
# USER_SETTINGS = getattr(settings, 'YAK', None)
# DEFAULTS = {
#     'USER_APP_LABEL': 'test_app',
#     'USER_MODEL': 'user',
#     'USER_SERIALIZER': "test_app.api.serializers.UserSerializer",
#     'API_SCHEMA': 'api-schema-1.0.json',
#     'SOCIAL_MODEL': "test_app.models.Post",
#     'ALLOW_EMAIL': True,
#     'ALLOW_PUSH': True,
#     'EMAIL_NOTIFICATION_SUBJECT': 'Test Project Notification',
#     'PUSHWOOSH_AUTH_TOKEN': "",
#     'PUSHWOOSH_APP_CODE': "",
#     'PUSH_NOTIFICATION_HANDLER': "yak.rest_notifications.utils.send_pushwoosh_notification",
#     'SOCIAL_SHARE_DELAY': 60,
#     'USE_FACEBOOK_OG': False,
#     'FACEBOOK_OG_NAMESPACE': "",
#     'SERIALIZER_MAPPING': {},
#     'FLAKE8_CONFIG': None,
# }
# IMPORT_STRINGS = (
#     "USER_SERIALIZER",
#     "SOCIAL_MODEL",
#     "SERIALIZER_MAPPING",
# )


import json
import sys
from flake8.api.legacy import get_style_guide
from rest_framework.test import APITestCase
from django.conf import settings
from yak.settings import yak_settings
from django.test import TestCase
    def assertHttpApplicationError(self, resp):
        """
        Ensures the response is returning a HTTP 500.
        """
        return self.assertEqual(resp.status_code, 500, resp)

    def assertHttpNotImplemented(self, resp):
        """
        Ensures the response is returning a HTTP 501.
        """
        return self.assertEqual(resp.status_code, 501, resp)

    def assertValidJSONResponse(self, resp):
        """
        Given a ``HttpResponse`` coming back from using the ``client``, assert that
        you get back:

        * An HTTP 200
        * The correct content-type (``application/json``)
        """
        self.assertHttpOK(resp)
        self.assertTrue(resp['Content-Type'].startswith('application/json'))


class SchemaTestCase(APITestCaseWithAssertions):
    def setUp(self):
        super(SchemaTestCase, self).setUp()

        # Parse schema objects for use later
        self.schema_objects = {}

# Path: yak/settings.py
# def perform_import(val, setting_name):
#     def __getattr__(self, attr):
# class YAKAPISettings(APISettings):
# USER_SETTINGS = getattr(settings, 'YAK', None)
# DEFAULTS = {
#     'USER_APP_LABEL': 'test_app',
#     'USER_MODEL': 'user',
#     'USER_SERIALIZER': "test_app.api.serializers.UserSerializer",
#     'API_SCHEMA': 'api-schema-1.0.json',
#     'SOCIAL_MODEL': "test_app.models.Post",
#     'ALLOW_EMAIL': True,
#     'ALLOW_PUSH': True,
#     'EMAIL_NOTIFICATION_SUBJECT': 'Test Project Notification',
#     'PUSHWOOSH_AUTH_TOKEN': "",
#     'PUSHWOOSH_APP_CODE': "",
#     'PUSH_NOTIFICATION_HANDLER': "yak.rest_notifications.utils.send_pushwoosh_notification",
#     'SOCIAL_SHARE_DELAY': 60,
#     'USE_FACEBOOK_OG': False,
#     'FACEBOOK_OG_NAMESPACE': "",
#     'SERIALIZER_MAPPING': {},
#     'FLAKE8_CONFIG': None,
# }
# IMPORT_STRINGS = (
#     "USER_SERIALIZER",
#     "SOCIAL_MODEL",
#     "SERIALIZER_MAPPING",
# )


# Path: yak/rest_core/test.py
import json
import sys
from flake8.api.legacy import get_style_guide
from rest_framework.test import APITestCase
from django.conf import settings
from yak.settings import yak_settings
from django.test import TestCase

    def assertHttpApplicationError(self, resp):
        """
        Ensures the response is returning a HTTP 500.
        """
        return self.assertEqual(resp.status_code, 500, resp)

    def assertHttpNotImplemented(self, resp):
        """
        Ensures the response is returning a HTTP 501.
        """
        return self.assertEqual(resp.status_code, 501, resp)

    def assertValidJSONResponse(self, resp):
        """
        Given a ``HttpResponse`` coming back from using the ``client``, assert that
        you get back:

        * An HTTP 200
        * The correct content-type (``application/json``)
        """
        self.assertHttpOK(resp)
        self.assertTrue(resp['Content-Type'].startswith('application/json'))


class SchemaTestCase(APITestCaseWithAssertions):
    def setUp(self):
        super(SchemaTestCase, self).setUp()

        # Parse schema objects for use later
        self.schema_objects = {}

        with open(yak_settings.API_SCHEMA) as file: