diff --git a/examples/starwars/tests/test_schema.py b/examples/starwars/tests/test_schema.py new file mode 100644 index 00000000..264642ca --- /dev/null +++ b/examples/starwars/tests/test_schema.py @@ -0,0 +1,10 @@ + +from ..data import setup +from ..schema import schema, Droid + + +def test_query_types(): + graphql_type = Droid._meta.graphql_type + fields = graphql_type.get_fields() + assert fields['friends'].parent == Droid + assert fields \ No newline at end of file diff --git a/examples/starwars_relay/tests/test_connections.py b/examples/starwars_relay/tests/test_connections.py index 17b6865f..0ef14311 100644 --- a/examples/starwars_relay/tests/test_connections.py +++ b/examples/starwars_relay/tests/test_connections.py @@ -1,38 +1,38 @@ -from ..data import setup -from ..schema import schema +# from ..data import setup +# from ..schema import schema -setup() +# setup() -def test_correct_fetch_first_ship_rebels(): - query = ''' - query RebelsShipsQuery { - rebels { - name, - ships(first: 1) { - edges { - node { - name - } - } - } - } - } - ''' - expected = { - 'rebels': { - 'name': 'Alliance to Restore the Republic', - 'ships': { - 'edges': [ - { - 'node': { - 'name': 'X-Wing' - } - } - ] - } - } - } - result = schema.execute(query) - assert not result.errors - assert result.data == expected +# def test_correct_fetch_first_ship_rebels(): +# query = ''' +# query RebelsShipsQuery { +# rebels { +# name, +# ships(first: 1) { +# edges { +# node { +# name +# } +# } +# } +# } +# } +# ''' +# expected = { +# 'rebels': { +# 'name': 'Alliance to Restore the Republic', +# 'ships': { +# 'edges': [ +# { +# 'node': { +# 'name': 'X-Wing' +# } +# } +# ] +# } +# } +# } +# result = schema.execute(query) +# assert not result.errors +# assert result.data == expected diff --git a/examples/cookbook_django/README.md b/graphene-django/examples/cookbook_django/README.md similarity index 100% rename from examples/cookbook_django/README.md rename to graphene-django/examples/cookbook_django/README.md diff --git a/examples/cookbook_django/cookbook/__init__.py b/graphene-django/examples/cookbook_django/cookbook/__init__.py similarity index 100% rename from examples/cookbook_django/cookbook/__init__.py rename to graphene-django/examples/cookbook_django/cookbook/__init__.py diff --git a/examples/cookbook_django/cookbook/ingredients/__init__.py b/graphene-django/examples/cookbook_django/cookbook/ingredients/__init__.py similarity index 100% rename from examples/cookbook_django/cookbook/ingredients/__init__.py rename to graphene-django/examples/cookbook_django/cookbook/ingredients/__init__.py diff --git a/examples/cookbook_django/cookbook/ingredients/admin.py b/graphene-django/examples/cookbook_django/cookbook/ingredients/admin.py similarity index 100% rename from examples/cookbook_django/cookbook/ingredients/admin.py rename to graphene-django/examples/cookbook_django/cookbook/ingredients/admin.py diff --git a/examples/cookbook_django/cookbook/ingredients/apps.py b/graphene-django/examples/cookbook_django/cookbook/ingredients/apps.py similarity index 100% rename from examples/cookbook_django/cookbook/ingredients/apps.py rename to graphene-django/examples/cookbook_django/cookbook/ingredients/apps.py diff --git a/examples/cookbook_django/cookbook/ingredients/fixtures/ingredients.json b/graphene-django/examples/cookbook_django/cookbook/ingredients/fixtures/ingredients.json similarity index 100% rename from examples/cookbook_django/cookbook/ingredients/fixtures/ingredients.json rename to graphene-django/examples/cookbook_django/cookbook/ingredients/fixtures/ingredients.json diff --git a/examples/cookbook_django/cookbook/ingredients/migrations/0001_initial.py b/graphene-django/examples/cookbook_django/cookbook/ingredients/migrations/0001_initial.py similarity index 100% rename from examples/cookbook_django/cookbook/ingredients/migrations/0001_initial.py rename to graphene-django/examples/cookbook_django/cookbook/ingredients/migrations/0001_initial.py diff --git a/examples/cookbook_django/cookbook/ingredients/migrations/__init__.py b/graphene-django/examples/cookbook_django/cookbook/ingredients/migrations/__init__.py similarity index 100% rename from examples/cookbook_django/cookbook/ingredients/migrations/__init__.py rename to graphene-django/examples/cookbook_django/cookbook/ingredients/migrations/__init__.py diff --git a/examples/cookbook_django/cookbook/ingredients/models.py b/graphene-django/examples/cookbook_django/cookbook/ingredients/models.py similarity index 100% rename from examples/cookbook_django/cookbook/ingredients/models.py rename to graphene-django/examples/cookbook_django/cookbook/ingredients/models.py diff --git a/examples/cookbook_django/cookbook/ingredients/schema.py b/graphene-django/examples/cookbook_django/cookbook/ingredients/schema.py similarity index 100% rename from examples/cookbook_django/cookbook/ingredients/schema.py rename to graphene-django/examples/cookbook_django/cookbook/ingredients/schema.py diff --git a/examples/cookbook_django/cookbook/ingredients/tests.py b/graphene-django/examples/cookbook_django/cookbook/ingredients/tests.py similarity index 100% rename from examples/cookbook_django/cookbook/ingredients/tests.py rename to graphene-django/examples/cookbook_django/cookbook/ingredients/tests.py diff --git a/examples/cookbook_django/cookbook/ingredients/views.py b/graphene-django/examples/cookbook_django/cookbook/ingredients/views.py similarity index 100% rename from examples/cookbook_django/cookbook/ingredients/views.py rename to graphene-django/examples/cookbook_django/cookbook/ingredients/views.py diff --git a/examples/cookbook_django/cookbook/recipes/__init__.py b/graphene-django/examples/cookbook_django/cookbook/recipes/__init__.py similarity index 100% rename from examples/cookbook_django/cookbook/recipes/__init__.py rename to graphene-django/examples/cookbook_django/cookbook/recipes/__init__.py diff --git a/examples/cookbook_django/cookbook/recipes/admin.py b/graphene-django/examples/cookbook_django/cookbook/recipes/admin.py similarity index 100% rename from examples/cookbook_django/cookbook/recipes/admin.py rename to graphene-django/examples/cookbook_django/cookbook/recipes/admin.py diff --git a/examples/cookbook_django/cookbook/recipes/apps.py b/graphene-django/examples/cookbook_django/cookbook/recipes/apps.py similarity index 100% rename from examples/cookbook_django/cookbook/recipes/apps.py rename to graphene-django/examples/cookbook_django/cookbook/recipes/apps.py diff --git a/examples/cookbook_django/cookbook/recipes/migrations/0001_initial.py b/graphene-django/examples/cookbook_django/cookbook/recipes/migrations/0001_initial.py similarity index 100% rename from examples/cookbook_django/cookbook/recipes/migrations/0001_initial.py rename to graphene-django/examples/cookbook_django/cookbook/recipes/migrations/0001_initial.py diff --git a/examples/cookbook_django/cookbook/recipes/migrations/__init__.py b/graphene-django/examples/cookbook_django/cookbook/recipes/migrations/__init__.py similarity index 100% rename from examples/cookbook_django/cookbook/recipes/migrations/__init__.py rename to graphene-django/examples/cookbook_django/cookbook/recipes/migrations/__init__.py diff --git a/examples/cookbook_django/cookbook/recipes/models.py b/graphene-django/examples/cookbook_django/cookbook/recipes/models.py similarity index 100% rename from examples/cookbook_django/cookbook/recipes/models.py rename to graphene-django/examples/cookbook_django/cookbook/recipes/models.py diff --git a/examples/cookbook_django/cookbook/recipes/tests.py b/graphene-django/examples/cookbook_django/cookbook/recipes/tests.py similarity index 100% rename from examples/cookbook_django/cookbook/recipes/tests.py rename to graphene-django/examples/cookbook_django/cookbook/recipes/tests.py diff --git a/examples/cookbook_django/cookbook/recipes/views.py b/graphene-django/examples/cookbook_django/cookbook/recipes/views.py similarity index 100% rename from examples/cookbook_django/cookbook/recipes/views.py rename to graphene-django/examples/cookbook_django/cookbook/recipes/views.py diff --git a/examples/cookbook_django/cookbook/schema.py b/graphene-django/examples/cookbook_django/cookbook/schema.py similarity index 100% rename from examples/cookbook_django/cookbook/schema.py rename to graphene-django/examples/cookbook_django/cookbook/schema.py diff --git a/examples/cookbook_django/cookbook/settings.py b/graphene-django/examples/cookbook_django/cookbook/settings.py similarity index 100% rename from examples/cookbook_django/cookbook/settings.py rename to graphene-django/examples/cookbook_django/cookbook/settings.py diff --git a/examples/cookbook_django/cookbook/urls.py b/graphene-django/examples/cookbook_django/cookbook/urls.py similarity index 100% rename from examples/cookbook_django/cookbook/urls.py rename to graphene-django/examples/cookbook_django/cookbook/urls.py diff --git a/examples/cookbook_django/cookbook/wsgi.py b/graphene-django/examples/cookbook_django/cookbook/wsgi.py similarity index 100% rename from examples/cookbook_django/cookbook/wsgi.py rename to graphene-django/examples/cookbook_django/cookbook/wsgi.py diff --git a/examples/cookbook_django/manage.py b/graphene-django/examples/cookbook_django/manage.py similarity index 100% rename from examples/cookbook_django/manage.py rename to graphene-django/examples/cookbook_django/manage.py diff --git a/examples/cookbook_django/requirements.txt b/graphene-django/examples/cookbook_django/requirements.txt similarity index 100% rename from examples/cookbook_django/requirements.txt rename to graphene-django/examples/cookbook_django/requirements.txt diff --git a/examples/flask_sqlalchemy/__init__.py b/graphene-django/examples/starwars_django/__init__.py similarity index 100% rename from examples/flask_sqlalchemy/__init__.py rename to graphene-django/examples/starwars_django/__init__.py diff --git a/examples/starwars_django/data.py b/graphene-django/examples/starwars_django/data.py similarity index 100% rename from examples/starwars_django/data.py rename to graphene-django/examples/starwars_django/data.py diff --git a/examples/starwars_django/models.py b/graphene-django/examples/starwars_django/models.py similarity index 100% rename from examples/starwars_django/models.py rename to graphene-django/examples/starwars_django/models.py diff --git a/examples/starwars_django/schema.py b/graphene-django/examples/starwars_django/schema.py similarity index 100% rename from examples/starwars_django/schema.py rename to graphene-django/examples/starwars_django/schema.py diff --git a/examples/starwars_django/__init__.py b/graphene-django/examples/starwars_django/tests/__init__.py similarity index 100% rename from examples/starwars_django/__init__.py rename to graphene-django/examples/starwars_django/tests/__init__.py diff --git a/examples/starwars_django/tests/test_connections.py b/graphene-django/examples/starwars_django/tests/test_connections.py similarity index 100% rename from examples/starwars_django/tests/test_connections.py rename to graphene-django/examples/starwars_django/tests/test_connections.py diff --git a/examples/starwars_django/tests/test_mutation.py b/graphene-django/examples/starwars_django/tests/test_mutation.py similarity index 100% rename from examples/starwars_django/tests/test_mutation.py rename to graphene-django/examples/starwars_django/tests/test_mutation.py diff --git a/examples/starwars_django/tests/test_objectidentification.py b/graphene-django/examples/starwars_django/tests/test_objectidentification.py similarity index 100% rename from examples/starwars_django/tests/test_objectidentification.py rename to graphene-django/examples/starwars_django/tests/test_objectidentification.py diff --git a/examples/flask_sqlalchemy/README.md b/graphene-sqlalchemy/examples/flask_sqlalchemy/README.md similarity index 100% rename from examples/flask_sqlalchemy/README.md rename to graphene-sqlalchemy/examples/flask_sqlalchemy/README.md diff --git a/examples/starwars_django/tests/__init__.py b/graphene-sqlalchemy/examples/flask_sqlalchemy/__init__.py similarity index 100% rename from examples/starwars_django/tests/__init__.py rename to graphene-sqlalchemy/examples/flask_sqlalchemy/__init__.py diff --git a/examples/flask_sqlalchemy/app.py b/graphene-sqlalchemy/examples/flask_sqlalchemy/app.py similarity index 100% rename from examples/flask_sqlalchemy/app.py rename to graphene-sqlalchemy/examples/flask_sqlalchemy/app.py diff --git a/examples/flask_sqlalchemy/database.py b/graphene-sqlalchemy/examples/flask_sqlalchemy/database.py similarity index 100% rename from examples/flask_sqlalchemy/database.py rename to graphene-sqlalchemy/examples/flask_sqlalchemy/database.py diff --git a/examples/flask_sqlalchemy/models.py b/graphene-sqlalchemy/examples/flask_sqlalchemy/models.py similarity index 100% rename from examples/flask_sqlalchemy/models.py rename to graphene-sqlalchemy/examples/flask_sqlalchemy/models.py diff --git a/examples/flask_sqlalchemy/requirements.txt b/graphene-sqlalchemy/examples/flask_sqlalchemy/requirements.txt similarity index 100% rename from examples/flask_sqlalchemy/requirements.txt rename to graphene-sqlalchemy/examples/flask_sqlalchemy/requirements.txt diff --git a/examples/flask_sqlalchemy/schema.py b/graphene-sqlalchemy/examples/flask_sqlalchemy/schema.py similarity index 100% rename from examples/flask_sqlalchemy/schema.py rename to graphene-sqlalchemy/examples/flask_sqlalchemy/schema.py