Skip to content

Fix failing tests #931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ jobs:
- python: 3.7
env: DJANGO=master

- python: 3.8
env: DJANGO=1.11
- python: 3.8
env: DJANGO=2.0
- python: 3.8
env: DJANGO=2.1
- python: 3.8
env: DJANGO=2.2
- python: 3.8
env: DJANGO=3.0
- python: 3.8
env: DJANGO=master

- python: 3.7
env: TOXENV=black,flake8

Expand Down
21 changes: 3 additions & 18 deletions graphene_django/forms/tests/test_mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from graphene import ObjectType, Schema, String, Field
from graphene_django import DjangoObjectType
from graphene_django.tests.models import Film, FilmDetails, Pet
from graphene_django.tests.models import Film, Pet

from ...settings import graphene_settings
from ..mutation import DjangoFormMutation, DjangoModelFormMutation
Expand Down Expand Up @@ -42,12 +42,6 @@ class Meta:
fields = "__all__"


class FilmDetailsType(DjangoObjectType):
class Meta:
model = FilmDetails
fields = "__all__"


def test_needs_form_class():
with raises(Exception) as exc:

Expand Down Expand Up @@ -185,23 +179,14 @@ class Meta:
self.assertIn("client_mutation_id", PetMutation.Input._meta.fields)
self.assertNotIn("id", PetMutation.Input._meta.fields)

def test_return_field_name_is_camelcased(self):
class PetMutation(DjangoModelFormMutation):
class Meta:
form_class = PetForm
model = FilmDetails

self.assertEqual(PetMutation._meta.model, FilmDetails)
self.assertEqual(PetMutation._meta.return_field_name, "filmDetails")

def test_custom_return_field_name(self):
class PetMutation(DjangoModelFormMutation):
class Meta:
form_class = PetForm
model = Film
model = Pet
return_field_name = "animal"

self.assertEqual(PetMutation._meta.model, Film)
self.assertEqual(PetMutation._meta.model, Pet)
self.assertEqual(PetMutation._meta.return_field_name, "animal")
self.assertIn("animal", PetMutation._meta.fields)

Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py{27,35,36,37}-django{111,20,21,22,master},
py{36,37}-django30,
py{27,35,36,37,38}-django{111,20,21,22,master},
py{36,37,38}-django30,
black,flake8

[travis:env]
Expand Down