diff --git a/graphene/types/tests/test_enum.py b/graphene/types/tests/test_enum.py index 0663784d..b5448cd6 100644 --- a/graphene/types/tests/test_enum.py +++ b/graphene/types/tests/test_enum.py @@ -486,9 +486,6 @@ def test_enum_inheritance(): class Query(ObjectType): color = ChildRGB(required=True) - def resolve_color(_, info): - return ChildRGB.RED - schema = Schema(query=Query) assert str(schema) == dedent( '''\ @@ -502,3 +499,49 @@ def test_enum_inheritance(): } ''' ) + + +def test_multiple_enum_inheritance(): + class Parent1RGB(Enum): + RED = 1 + + class Parent2RGB(Enum): + BLUE = 2 + + class ChildRGB(Enum): + GREEN = 3 + + class Meta: + enums = (Parent1RGB, Parent2RGB,) + + class Query(ObjectType): + color = ChildRGB(required=True) + + schema = Schema(query=Query) + assert str(schema) == dedent( + '''\ + type Query { + color: ChildRGB! + } + + enum ChildRGB { + RED + BLUE + GREEN + } + ''' + ) + + +def test_override_enum_inheritance(): + class ParentRGB(Enum): + RED = 1 + BLUE = 2 + + class ChildRGB(Enum): + BLUE = 3 + + class Meta: + enums = (ParentRGB,) + + assert ChildRGB.get(3) != ParentRGB.BLUE