GraphQLTestCase inherits from Django's TestCase, which requires a database
See original GitHub issueI’m using Django in a project which doesn’t use a database, however I can’t use graphene-django’s GraphQLTestCase
, as it inherits from Django’s TestCase
(I’m using SimpleTestCase
elsewhere).
Could GraphQLTestCase
extend from SimpleTestCase
? Or if this is not desired because the most common usage does involve a database, could we move the methods to a mixin, so I can use this in combination with SimpleTestCase
?
I can’t see anything in GraphQLTestCase
which actually requires a Django database to be configured.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Testing Django GraphQL API with database - Stack Overflow
I read in Django Test Database looks empty while test is runnin that this is a result from GraphQLTestCase inheriting from TestCase.
Read more >Testing tools - Django documentation
It inherits from TransactionTestCase (and by extension SimpleTestCase ). If your Django application doesn't use a database, use SimpleTestCase .
Read more >Django + Graphene: From REST to GraphQL - FullStack Labs
This walk-through demonstrates the power of using Graphene with Django by covering the ... our test class must inherit from the GraphQLTestCase class, ......
Read more >Testing API calls with django - Graphene-Python
If you want to unittest your API calls derive your test case from the class GraphQLTestCase . Your endpoint is set through the...
Read more >Testing Your Django App With Pytest
TestCase . We'll use it constantly, because Django needs access to DB. If you want to get access to the Django database inside...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Maybe another test class like
GraphQLSimpleTestCase
?Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.