mirror of
https://github.com/graphql-python/graphene.git
synced 2024-12-01 14:03:58 +03:00
Improved Django tests
This commit is contained in:
parent
e14f1fdd34
commit
6673582e9d
|
@ -1,19 +1,4 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
import django
|
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
settings.configure(
|
|
||||||
DATABASES={
|
|
||||||
'INSTALLED_APPS': [
|
|
||||||
'graphql.contrib.django',
|
|
||||||
],
|
|
||||||
'default': {
|
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
|
||||||
'NAME': 'db_test.sqlite',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
class Reporter(models.Model):
|
class Reporter(models.Model):
|
||||||
|
@ -25,7 +10,7 @@ class Reporter(models.Model):
|
||||||
return "%s %s" % (self.first_name, self.last_name)
|
return "%s %s" % (self.first_name, self.last_name)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
app_label = 'graphql'
|
app_label = 'contrib_django'
|
||||||
|
|
||||||
class Article(models.Model):
|
class Article(models.Model):
|
||||||
headline = models.CharField(max_length=100)
|
headline = models.CharField(max_length=100)
|
||||||
|
@ -37,7 +22,4 @@ class Article(models.Model):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ('headline',)
|
ordering = ('headline',)
|
||||||
app_label = 'graphql'
|
app_label = 'contrib_django'
|
||||||
|
|
||||||
|
|
||||||
django.setup()
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
SECRET_KEY = 1
|
SECRET_KEY = 1
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
'graphql.contrib.django',
|
'graphene.contrib.django',
|
||||||
'tests.starwars_django',
|
'tests.starwars_django',
|
||||||
|
'tests.contrib_django',
|
||||||
]
|
]
|
||||||
|
|
||||||
DATABASES={
|
DATABASES={
|
||||||
|
|
Loading…
Reference in New Issue
Block a user