# 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
            self.assertTrue(response['Content-Type'].startswith('application/json'))

            # Check the video and thumbnail are saved
            if related_media_model and related_name:
                filters = {
                    related_name: obj_to_update
                }
                obj_to_update = related_media_model.objects.filter(**filters)[0]
            else:
                obj_to_update = obj_to_update.__class__.objects.get(pk=obj_to_update.pk)
            original_file_field_name = getattr(obj_to_update, "original_file_name", "original_file")
            original_file = getattr(obj_to_update, original_file_field_name)
            self.assertEqual(
                original_file.file.read(),
                open(settings.PROJECT_ROOT + path_to_video, 'r').read()
            )
            self.assertEqual(
                obj_to_update.thumbnail.file.read(),
                open(settings.PROJECT_ROOT + path_to_thumbnail, 'r').read()
            )


class YAKSyntaxTest(TestCase):
    def check_syntax(self):
        """
        From flake8
        """
        packages = settings.PACKAGES_TO_TEST

        # Prepare

# 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

            self.assertTrue(response['Content-Type'].startswith('application/json'))

            # Check the video and thumbnail are saved
            if related_media_model and related_name:
                filters = {
                    related_name: obj_to_update
                }
                obj_to_update = related_media_model.objects.filter(**filters)[0]
            else:
                obj_to_update = obj_to_update.__class__.objects.get(pk=obj_to_update.pk)
            original_file_field_name = getattr(obj_to_update, "original_file_name", "original_file")
            original_file = getattr(obj_to_update, original_file_field_name)
            self.assertEqual(
                original_file.file.read(),
                open(settings.PROJECT_ROOT + path_to_video, 'r').read()
            )
            self.assertEqual(
                obj_to_update.thumbnail.file.read(),
                open(settings.PROJECT_ROOT + path_to_thumbnail, 'r').read()
            )


class YAKSyntaxTest(TestCase):
    def check_syntax(self):
        """
        From flake8
        """
        packages = settings.PACKAGES_TO_TEST

        # Prepare

        config_options = getattr(yak_settings, 'FLAKE8_CONFIG', {})