Skip to content

Commit 073dc55

Browse files
author
Denny Weinberg
committed
Added test for connection factory Description
1 parent ec928df commit 073dc55

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

graphene_sqlalchemy/fields.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,8 @@ def createConnectionField(_type):
5353
def registerConnectionFieldFactory(factoryMethod):
5454
global __connectionFactory
5555
__connectionFactory = factoryMethod
56+
57+
58+
def unregisterConnectionFieldFactory():
59+
global __connectionFactory
60+
__connectionFactory = SQLAlchemyConnectionField

graphene_sqlalchemy/tests/test_connectionfactory.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from graphene_sqlalchemy.fields import SQLAlchemyConnectionField, registerConnectionFieldFactory
1+
from graphene_sqlalchemy.fields import SQLAlchemyConnectionField, registerConnectionFieldFactory, unregisterConnectionFieldFactory
22
import graphene
33

44
def test_register():
@@ -25,5 +25,4 @@ def createLXConnectionField(table):
2525
return LXConnectionField(table, filter=table.filter(), order_by=graphene.List(of_type=table.order_by))
2626

2727
registerConnectionFieldFactory(createLXConnectionField)
28-
29-
28+
unregisterConnectionFieldFactory()

0 commit comments

Comments
 (0)