mirror of
https://github.com/PokeAPI/pokeapi
synced 2025-02-16 20:48:25 +00:00
fix conflicts
This commit is contained in:
commit
5e1432a677
5 changed files with 34 additions and 2 deletions
3
Makefile
3
Makefile
|
@ -12,7 +12,8 @@ serve:
|
||||||
python manage.py runserver --settings=config.local
|
python manage.py runserver --settings=config.local
|
||||||
|
|
||||||
test:
|
test:
|
||||||
python manage.py test pokemon --settings=config.local
|
python manage.py test pokemon_v1 --settings=config.local
|
||||||
|
python manage.py test pokemon_v2 --settings=config.local
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf *.pyc
|
rm -rf *.pyc
|
||||||
|
|
|
@ -4,7 +4,6 @@ import os
|
||||||
|
|
||||||
PROJECT_ROOT = Path(__file__).ancestor(2)
|
PROJECT_ROOT = Path(__file__).ancestor(2)
|
||||||
|
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
TEMPLATE_DEBUG = DEBUG
|
TEMPLATE_DEBUG = DEBUG
|
||||||
|
|
||||||
|
@ -62,6 +61,7 @@ TEMPLATE_LOADERS = (
|
||||||
)
|
)
|
||||||
|
|
||||||
MIDDLEWARE_CLASSES = (
|
MIDDLEWARE_CLASSES = (
|
||||||
|
'corsheaders.middleware.CorsMiddleware',
|
||||||
'django.middleware.common.CommonMiddleware',
|
'django.middleware.common.CommonMiddleware',
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
'django.middleware.csrf.CsrfViewMiddleware',
|
'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
|
@ -119,9 +119,15 @@ INSTALLED_APPS = (
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
'django.contrib.humanize',
|
'django.contrib.humanize',
|
||||||
|
'corsheaders'
|
||||||
) + CUSTOM_APPS
|
) + CUSTOM_APPS
|
||||||
|
|
||||||
|
|
||||||
API_LIMIT_PER_PAGE = 1
|
API_LIMIT_PER_PAGE = 1
|
||||||
|
|
||||||
TASTYPIE_DEFAULT_FORMATS = ['json', 'xml']
|
TASTYPIE_DEFAULT_FORMATS = ['json', 'xml']
|
||||||
|
|
||||||
|
CORS_ORIGIN_ALLOW_ALL = True
|
||||||
|
CORS_ALLOW_METHODS = (
|
||||||
|
'GET'
|
||||||
|
)
|
||||||
|
|
|
@ -1,2 +1,14 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
|
class HeaderTest(TestCase):
|
||||||
|
|
||||||
|
def test_pokemon(self):
|
||||||
|
|
||||||
|
response = self.client.get(
|
||||||
|
'/api/v1/pokemon/1/',
|
||||||
|
HTTP_ORIGIN="http://pokemon.com"
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertEqual(response['Access-Control-Allow-Origin'], '*')
|
||||||
|
|
||||||
|
|
|
@ -2,3 +2,15 @@ from __future__ import unicode_literals
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
# Create your tests here.
|
# Create your tests here.
|
||||||
|
|
||||||
|
class HeaderTest(TestCase):
|
||||||
|
|
||||||
|
def test_pokemon(self):
|
||||||
|
|
||||||
|
response = self.client.get(
|
||||||
|
'/api/v2/pokemon/1/',
|
||||||
|
HTTP_ORIGIN="http://pokemon.com"
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertEqual(response['Access-Control-Allow-Origin'], '*')
|
||||||
|
|
||||||
|
|
|
@ -17,3 +17,4 @@ python-mimeparse==0.1.4
|
||||||
simplejson==3.6.5
|
simplejson==3.6.5
|
||||||
six==1.8.0
|
six==1.8.0
|
||||||
wsgiref==0.1.2
|
wsgiref==0.1.2
|
||||||
|
django-cors-headers=0.13
|
||||||
|
|
Loading…
Add table
Reference in a new issue