mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-11 08:42:32 +03:00
Implement mock.patch.dict
This commit is contained in:
parent
26b95100d0
commit
8b961fbc1e
|
@ -568,335 +568,263 @@ def test_passes_request_into_context_request(client):
|
||||||
assert response_json(response) == {"data": {"request": "testing"}}
|
assert response_json(response) == {"data": {"request": "testing"}}
|
||||||
|
|
||||||
|
|
||||||
|
@patch("graphene_django.settings.graphene_settings.ATOMIC_MUTATIONS", False)
|
||||||
|
@patch.dict(
|
||||||
|
connection.settings_dict, {"ATOMIC_MUTATIONS": False, "ATOMIC_REQUESTS": True}
|
||||||
|
)
|
||||||
def test_form_mutation_multiple_creation_invalid_atomic_request(client):
|
def test_form_mutation_multiple_creation_invalid_atomic_request(client):
|
||||||
old_atomic_mutations = connection.settings_dict.get("ATOMIC_MUTATIONS", False)
|
query = """
|
||||||
old_atomic_requests = connection.settings_dict["ATOMIC_REQUESTS"]
|
mutation PetMutations {
|
||||||
old_graphene_atomic_mutations = graphene_settings.ATOMIC_MUTATIONS
|
petFormMutation1: petFormMutation(input: { name: "Mia", age: 99 }) {
|
||||||
try:
|
errors {
|
||||||
connection.settings_dict["ATOMIC_MUTATIONS"] = False
|
field
|
||||||
connection.settings_dict["ATOMIC_REQUESTS"] = True
|
messages
|
||||||
graphene_settings.ATOMIC_MUTATIONS = False
|
|
||||||
|
|
||||||
query = """
|
|
||||||
mutation PetMutations {
|
|
||||||
petFormMutation1: petFormMutation(input: { name: "Mia", age: 99 }) {
|
|
||||||
errors {
|
|
||||||
field
|
|
||||||
messages
|
|
||||||
}
|
|
||||||
}
|
|
||||||
petFormMutation2: petFormMutation(input: { name: "Enzo", age: 0 }) {
|
|
||||||
errors {
|
|
||||||
field
|
|
||||||
messages
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
petFormMutation2: petFormMutation(input: { name: "Enzo", age: 0 }) {
|
||||||
|
errors {
|
||||||
|
field
|
||||||
|
messages
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
response = client.post(url_string(query=query))
|
response = client.post(url_string(query=query))
|
||||||
content = response_json(response)
|
content = response_json(response)
|
||||||
|
|
||||||
assert "errors" not in content
|
assert "errors" not in content
|
||||||
|
|
||||||
assert content["data"]["petFormMutation1"]["errors"] == [
|
assert content["data"]["petFormMutation1"]["errors"] == [
|
||||||
{"field": "age", "messages": ["Too old"]}
|
{"field": "age", "messages": ["Too old"]}
|
||||||
]
|
]
|
||||||
|
|
||||||
assert content["data"]["petFormMutation2"]["errors"] == []
|
assert content["data"]["petFormMutation2"]["errors"] == []
|
||||||
|
|
||||||
assert Pet.objects.count() == 0
|
assert Pet.objects.count() == 0
|
||||||
|
|
||||||
finally:
|
|
||||||
connection.settings_dict["ATOMIC_MUTATIONS"] = old_atomic_mutations
|
|
||||||
connection.settings_dict["ATOMIC_REQUESTS"] = old_atomic_requests
|
|
||||||
graphene_settings.ATOMIC_MUTATIONS = old_graphene_atomic_mutations
|
|
||||||
|
|
||||||
|
|
||||||
|
@patch("graphene_django.settings.graphene_settings.ATOMIC_MUTATIONS", False)
|
||||||
|
@patch.dict(
|
||||||
|
connection.settings_dict, {"ATOMIC_MUTATIONS": True, "ATOMIC_REQUESTS": False}
|
||||||
|
)
|
||||||
def test_form_mutation_multiple_creation_invalid_atomic_mutation_1(client):
|
def test_form_mutation_multiple_creation_invalid_atomic_mutation_1(client):
|
||||||
old_atomic_mutations = connection.settings_dict.get("ATOMIC_MUTATIONS", False)
|
query = """
|
||||||
old_atomic_requests = connection.settings_dict["ATOMIC_REQUESTS"]
|
mutation PetMutations {
|
||||||
old_graphene_atomic_mutations = graphene_settings.ATOMIC_MUTATIONS
|
petFormMutation1: petFormMutation(input: { name: "Mia", age: 99 }) {
|
||||||
try:
|
errors {
|
||||||
connection.settings_dict["ATOMIC_MUTATIONS"] = True
|
field
|
||||||
connection.settings_dict["ATOMIC_REQUESTS"] = False
|
messages
|
||||||
graphene_settings.ATOMIC_MUTATIONS = False
|
|
||||||
|
|
||||||
query = """
|
|
||||||
mutation PetMutations {
|
|
||||||
petFormMutation1: petFormMutation(input: { name: "Mia", age: 99 }) {
|
|
||||||
errors {
|
|
||||||
field
|
|
||||||
messages
|
|
||||||
}
|
|
||||||
}
|
|
||||||
petFormMutation2: petFormMutation(input: { name: "Enzo", age: 0 }) {
|
|
||||||
errors {
|
|
||||||
field
|
|
||||||
messages
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
petFormMutation2: petFormMutation(input: { name: "Enzo", age: 0 }) {
|
||||||
|
errors {
|
||||||
|
field
|
||||||
|
messages
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
response = client.post(url_string(query=query))
|
response = client.post(url_string(query=query))
|
||||||
content = response_json(response)
|
content = response_json(response)
|
||||||
|
|
||||||
assert "errors" not in content
|
assert "errors" not in content
|
||||||
|
|
||||||
assert content["data"]["petFormMutation1"]["errors"] == [
|
assert content["data"]["petFormMutation1"]["errors"] == [
|
||||||
{"field": "age", "messages": ["Too old"]}
|
{"field": "age", "messages": ["Too old"]}
|
||||||
]
|
]
|
||||||
|
|
||||||
assert content["data"]["petFormMutation2"]["errors"] == []
|
assert content["data"]["petFormMutation2"]["errors"] == []
|
||||||
|
|
||||||
assert Pet.objects.count() == 0
|
assert Pet.objects.count() == 0
|
||||||
|
|
||||||
finally:
|
|
||||||
connection.settings_dict["ATOMIC_MUTATIONS"] = old_atomic_mutations
|
|
||||||
connection.settings_dict["ATOMIC_REQUESTS"] = old_atomic_requests
|
|
||||||
graphene_settings.ATOMIC_MUTATIONS = old_graphene_atomic_mutations
|
|
||||||
|
|
||||||
|
|
||||||
|
@patch("graphene_django.settings.graphene_settings.ATOMIC_MUTATIONS", True)
|
||||||
|
@patch.dict(
|
||||||
|
connection.settings_dict, {"ATOMIC_MUTATIONS": False, "ATOMIC_REQUESTS": False}
|
||||||
|
)
|
||||||
def test_form_mutation_multiple_creation_invalid_atomic_mutation_2(client):
|
def test_form_mutation_multiple_creation_invalid_atomic_mutation_2(client):
|
||||||
old_atomic_mutations = connection.settings_dict.get("ATOMIC_MUTATIONS", False)
|
query = """
|
||||||
old_atomic_requests = connection.settings_dict["ATOMIC_REQUESTS"]
|
mutation PetMutations {
|
||||||
old_graphene_atomic_mutations = graphene_settings.ATOMIC_MUTATIONS
|
petFormMutation1: petFormMutation(input: { name: "Mia", age: 99 }) {
|
||||||
try:
|
errors {
|
||||||
connection.settings_dict["ATOMIC_MUTATIONS"] = False
|
field
|
||||||
connection.settings_dict["ATOMIC_REQUESTS"] = False
|
messages
|
||||||
graphene_settings.ATOMIC_MUTATIONS = True
|
|
||||||
|
|
||||||
query = """
|
|
||||||
mutation PetMutations {
|
|
||||||
petFormMutation1: petFormMutation(input: { name: "Mia", age: 99 }) {
|
|
||||||
errors {
|
|
||||||
field
|
|
||||||
messages
|
|
||||||
}
|
|
||||||
}
|
|
||||||
petFormMutation2: petFormMutation(input: { name: "Enzo", age: 0 }) {
|
|
||||||
errors {
|
|
||||||
field
|
|
||||||
messages
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
petFormMutation2: petFormMutation(input: { name: "Enzo", age: 0 }) {
|
||||||
|
errors {
|
||||||
|
field
|
||||||
|
messages
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
response = client.post(url_string(query=query))
|
response = client.post(url_string(query=query))
|
||||||
content = response_json(response)
|
content = response_json(response)
|
||||||
|
|
||||||
assert "errors" not in content
|
assert "errors" not in content
|
||||||
|
|
||||||
assert content["data"]["petFormMutation1"]["errors"] == [
|
assert content["data"]["petFormMutation1"]["errors"] == [
|
||||||
{"field": "age", "messages": ["Too old"]}
|
{"field": "age", "messages": ["Too old"]}
|
||||||
]
|
]
|
||||||
|
|
||||||
assert content["data"]["petFormMutation2"]["errors"] == []
|
assert content["data"]["petFormMutation2"]["errors"] == []
|
||||||
|
|
||||||
assert Pet.objects.count() == 0
|
assert Pet.objects.count() == 0
|
||||||
|
|
||||||
finally:
|
|
||||||
connection.settings_dict["ATOMIC_MUTATIONS"] = old_atomic_mutations
|
|
||||||
connection.settings_dict["ATOMIC_REQUESTS"] = old_atomic_requests
|
|
||||||
graphene_settings.ATOMIC_MUTATIONS = old_graphene_atomic_mutations
|
|
||||||
|
|
||||||
|
|
||||||
|
@patch("graphene_django.settings.graphene_settings.ATOMIC_MUTATIONS", False)
|
||||||
|
@patch.dict(
|
||||||
|
connection.settings_dict, {"ATOMIC_MUTATIONS": False, "ATOMIC_REQUESTS": False}
|
||||||
|
)
|
||||||
def test_form_mutation_multiple_creation_invalid_non_atomic(client):
|
def test_form_mutation_multiple_creation_invalid_non_atomic(client):
|
||||||
old_atomic_mutations = connection.settings_dict.get("ATOMIC_MUTATIONS", False)
|
query = """
|
||||||
old_atomic_requests = connection.settings_dict["ATOMIC_REQUESTS"]
|
mutation PetMutations {
|
||||||
old_graphene_atomic_mutations = graphene_settings.ATOMIC_MUTATIONS
|
petFormMutation1: petFormMutation(input: { name: "Mia", age: 99 }) {
|
||||||
try:
|
errors {
|
||||||
connection.settings_dict["ATOMIC_MUTATIONS"] = False
|
field
|
||||||
connection.settings_dict["ATOMIC_REQUESTS"] = False
|
messages
|
||||||
graphene_settings.ATOMIC_MUTATIONS = False
|
|
||||||
|
|
||||||
query = """
|
|
||||||
mutation PetMutations {
|
|
||||||
petFormMutation1: petFormMutation(input: { name: "Mia", age: 99 }) {
|
|
||||||
errors {
|
|
||||||
field
|
|
||||||
messages
|
|
||||||
}
|
|
||||||
}
|
|
||||||
petFormMutation2: petFormMutation(input: { name: "Enzo", age: 0 }) {
|
|
||||||
errors {
|
|
||||||
field
|
|
||||||
messages
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
petFormMutation2: petFormMutation(input: { name: "Enzo", age: 0 }) {
|
||||||
|
errors {
|
||||||
|
field
|
||||||
|
messages
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
response = client.post(url_string(query=query))
|
response = client.post(url_string(query=query))
|
||||||
content = response_json(response)
|
content = response_json(response)
|
||||||
|
|
||||||
assert "errors" not in content
|
assert "errors" not in content
|
||||||
|
|
||||||
assert content["data"]["petFormMutation1"]["errors"] == [
|
assert content["data"]["petFormMutation1"]["errors"] == [
|
||||||
{"field": "age", "messages": ["Too old"]}
|
{"field": "age", "messages": ["Too old"]}
|
||||||
]
|
]
|
||||||
|
|
||||||
assert content["data"]["petFormMutation2"]["errors"] == []
|
assert content["data"]["petFormMutation2"]["errors"] == []
|
||||||
|
|
||||||
assert Pet.objects.count() == 1
|
assert Pet.objects.count() == 1
|
||||||
|
|
||||||
pet = Pet.objects.get()
|
pet = Pet.objects.get()
|
||||||
assert pet.name == "Enzo"
|
assert pet.name == "Enzo"
|
||||||
assert pet.age == 0
|
assert pet.age == 0
|
||||||
|
|
||||||
finally:
|
|
||||||
connection.settings_dict["ATOMIC_MUTATIONS"] = old_atomic_mutations
|
|
||||||
connection.settings_dict["ATOMIC_REQUESTS"] = old_atomic_requests
|
|
||||||
graphene_settings.ATOMIC_MUTATIONS = old_graphene_atomic_mutations
|
|
||||||
|
|
||||||
|
|
||||||
|
@patch("graphene_django.settings.graphene_settings.ATOMIC_MUTATIONS", False)
|
||||||
|
@patch.dict(
|
||||||
|
connection.settings_dict, {"ATOMIC_MUTATIONS": False, "ATOMIC_REQUESTS": True}
|
||||||
|
)
|
||||||
def test_model_form_mutation_multiple_creation_invalid_atomic_request(client):
|
def test_model_form_mutation_multiple_creation_invalid_atomic_request(client):
|
||||||
old_atomic_mutations = connection.settings_dict.get("ATOMIC_MUTATIONS", False)
|
query = """
|
||||||
old_atomic_requests = connection.settings_dict["ATOMIC_REQUESTS"]
|
mutation PetMutations {
|
||||||
old_graphene_atomic_mutations = graphene_settings.ATOMIC_MUTATIONS
|
petMutation1: petMutation(input: { name: "Mia", age: 99 }) {
|
||||||
try:
|
pet {
|
||||||
connection.settings_dict["ATOMIC_MUTATIONS"] = False
|
name
|
||||||
connection.settings_dict["ATOMIC_REQUESTS"] = True
|
age
|
||||||
graphene_settings.ATOMIC_MUTATIONS = False
|
|
||||||
|
|
||||||
query = """
|
|
||||||
mutation PetMutations {
|
|
||||||
petMutation1: petMutation(input: { name: "Mia", age: 99 }) {
|
|
||||||
pet {
|
|
||||||
name
|
|
||||||
age
|
|
||||||
}
|
|
||||||
errors {
|
|
||||||
field
|
|
||||||
messages
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
petMutation2: petMutation(input: { name: "Enzo", age: 0 }) {
|
errors {
|
||||||
pet {
|
field
|
||||||
name
|
messages
|
||||||
age
|
|
||||||
}
|
|
||||||
errors {
|
|
||||||
field
|
|
||||||
messages
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
petMutation2: petMutation(input: { name: "Enzo", age: 0 }) {
|
||||||
|
pet {
|
||||||
|
name
|
||||||
|
age
|
||||||
|
}
|
||||||
|
errors {
|
||||||
|
field
|
||||||
|
messages
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
response = client.post(url_string(query=query))
|
response = client.post(url_string(query=query))
|
||||||
content = response_json(response)
|
content = response_json(response)
|
||||||
|
|
||||||
assert "errors" not in content
|
assert "errors" not in content
|
||||||
|
|
||||||
assert content["data"]["petMutation1"]["pet"] is None
|
assert content["data"]["petMutation1"]["pet"] is None
|
||||||
assert content["data"]["petMutation1"]["errors"] == [
|
assert content["data"]["petMutation1"]["errors"] == [
|
||||||
{"field": "age", "messages": ["Too old"]}
|
{"field": "age", "messages": ["Too old"]}
|
||||||
]
|
]
|
||||||
|
|
||||||
assert content["data"]["petMutation2"]["pet"] == {"name": "Enzo", "age": 0}
|
assert content["data"]["petMutation2"]["pet"] == {"name": "Enzo", "age": 0}
|
||||||
|
|
||||||
assert Pet.objects.count() == 0
|
assert Pet.objects.count() == 0
|
||||||
|
|
||||||
finally:
|
|
||||||
connection.settings_dict["ATOMIC_MUTATIONS"] = old_atomic_mutations
|
|
||||||
connection.settings_dict["ATOMIC_REQUESTS"] = old_atomic_requests
|
|
||||||
graphene_settings.ATOMIC_MUTATIONS = old_graphene_atomic_mutations
|
|
||||||
|
|
||||||
|
|
||||||
|
@patch("graphene_django.settings.graphene_settings.ATOMIC_MUTATIONS", False)
|
||||||
|
@patch.dict(
|
||||||
|
connection.settings_dict, {"ATOMIC_MUTATIONS": False, "ATOMIC_REQUESTS": False}
|
||||||
|
)
|
||||||
def test_model_form_mutation_multiple_creation_invalid_non_atomic(client):
|
def test_model_form_mutation_multiple_creation_invalid_non_atomic(client):
|
||||||
old_atomic_mutations = connection.settings_dict.get("ATOMIC_MUTATIONS", False)
|
query = """
|
||||||
old_atomic_requests = connection.settings_dict["ATOMIC_REQUESTS"]
|
mutation PetMutations {
|
||||||
old_graphene_atomic_mutations = graphene_settings.ATOMIC_MUTATIONS
|
petMutation1: petMutation(input: { name: "Mia", age: 99 }) {
|
||||||
try:
|
pet {
|
||||||
connection.settings_dict["ATOMIC_MUTATIONS"] = False
|
name
|
||||||
connection.settings_dict["ATOMIC_REQUESTS"] = False
|
age
|
||||||
graphene_settings.ATOMIC_MUTATIONS = False
|
|
||||||
|
|
||||||
query = """
|
|
||||||
mutation PetMutations {
|
|
||||||
petMutation1: petMutation(input: { name: "Mia", age: 99 }) {
|
|
||||||
pet {
|
|
||||||
name
|
|
||||||
age
|
|
||||||
}
|
|
||||||
errors {
|
|
||||||
field
|
|
||||||
messages
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
petMutation2: petMutation(input: { name: "Enzo", age: 0 }) {
|
errors {
|
||||||
pet {
|
field
|
||||||
name
|
messages
|
||||||
age
|
|
||||||
}
|
|
||||||
errors {
|
|
||||||
field
|
|
||||||
messages
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
petMutation2: petMutation(input: { name: "Enzo", age: 0 }) {
|
||||||
|
pet {
|
||||||
|
name
|
||||||
|
age
|
||||||
|
}
|
||||||
|
errors {
|
||||||
|
field
|
||||||
|
messages
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
response = client.post(url_string(query=query))
|
response = client.post(url_string(query=query))
|
||||||
content = response_json(response)
|
content = response_json(response)
|
||||||
|
|
||||||
assert "errors" not in content
|
assert "errors" not in content
|
||||||
|
|
||||||
assert content["data"]["petMutation1"]["pet"] is None
|
assert content["data"]["petMutation1"]["pet"] is None
|
||||||
assert content["data"]["petMutation1"]["errors"] == [
|
assert content["data"]["petMutation1"]["errors"] == [
|
||||||
{"field": "age", "messages": ["Too old"]}
|
{"field": "age", "messages": ["Too old"]}
|
||||||
]
|
]
|
||||||
|
|
||||||
assert content["data"]["petMutation2"]["pet"] == {"name": "Enzo", "age": 0}
|
assert content["data"]["petMutation2"]["pet"] == {"name": "Enzo", "age": 0}
|
||||||
|
|
||||||
assert Pet.objects.count() == 1
|
assert Pet.objects.count() == 1
|
||||||
|
|
||||||
pet = Pet.objects.get()
|
pet = Pet.objects.get()
|
||||||
assert pet.name == "Enzo"
|
assert pet.name == "Enzo"
|
||||||
assert pet.age == 0
|
assert pet.age == 0
|
||||||
|
|
||||||
finally:
|
|
||||||
connection.settings_dict["ATOMIC_MUTATIONS"] = old_atomic_mutations
|
|
||||||
connection.settings_dict["ATOMIC_REQUESTS"] = old_atomic_requests
|
|
||||||
graphene_settings.ATOMIC_MUTATIONS = old_graphene_atomic_mutations
|
|
||||||
|
|
||||||
|
|
||||||
@patch("graphene_django.utils.utils.transaction.set_rollback")
|
@patch("graphene_django.utils.utils.transaction.set_rollback")
|
||||||
|
@patch("graphene_django.settings.graphene_settings.ATOMIC_MUTATIONS", False)
|
||||||
|
@patch.dict(
|
||||||
|
connection.settings_dict, {"ATOMIC_MUTATIONS": False, "ATOMIC_REQUESTS": True}
|
||||||
|
)
|
||||||
def test_query_errors_atomic_request(set_rollback_mock, client):
|
def test_query_errors_atomic_request(set_rollback_mock, client):
|
||||||
old_atomic_mutations = connection.settings_dict.get("ATOMIC_MUTATIONS", False)
|
client.get(url_string(query="force error"))
|
||||||
old_atomic_requests = connection.settings_dict["ATOMIC_REQUESTS"]
|
set_rollback_mock.assert_called_once_with(True)
|
||||||
old_graphene_atomic_mutations = graphene_settings.ATOMIC_MUTATIONS
|
|
||||||
try:
|
|
||||||
connection.settings_dict["ATOMIC_MUTATIONS"] = False
|
|
||||||
connection.settings_dict["ATOMIC_REQUESTS"] = True
|
|
||||||
graphene_settings.ATOMIC_MUTATIONS = False
|
|
||||||
|
|
||||||
client.get(url_string(query="force error"))
|
|
||||||
set_rollback_mock.assert_called_once_with(True)
|
|
||||||
|
|
||||||
finally:
|
|
||||||
connection.settings_dict["ATOMIC_MUTATIONS"] = old_atomic_mutations
|
|
||||||
connection.settings_dict["ATOMIC_REQUESTS"] = old_atomic_requests
|
|
||||||
graphene_settings.ATOMIC_MUTATIONS = old_graphene_atomic_mutations
|
|
||||||
|
|
||||||
|
|
||||||
@patch("graphene_django.utils.utils.transaction.set_rollback")
|
@patch("graphene_django.utils.utils.transaction.set_rollback")
|
||||||
|
@patch("graphene_django.settings.graphene_settings.ATOMIC_MUTATIONS", False)
|
||||||
|
@patch.dict(
|
||||||
|
connection.settings_dict, {"ATOMIC_MUTATIONS": False, "ATOMIC_REQUESTS": False}
|
||||||
|
)
|
||||||
def test_query_errors_non_atomic(set_rollback_mock, client):
|
def test_query_errors_non_atomic(set_rollback_mock, client):
|
||||||
old_atomic_mutations = connection.settings_dict.get("ATOMIC_MUTATIONS", False)
|
client.get(url_string(query="force error"))
|
||||||
old_atomic_requests = connection.settings_dict["ATOMIC_REQUESTS"]
|
set_rollback_mock.assert_not_called()
|
||||||
old_graphene_atomic_mutations = graphene_settings.ATOMIC_MUTATIONS
|
|
||||||
try:
|
|
||||||
connection.settings_dict["ATOMIC_MUTATIONS"] = False
|
|
||||||
connection.settings_dict["ATOMIC_REQUESTS"] = False
|
|
||||||
graphene_settings.ATOMIC_MUTATIONS = False
|
|
||||||
|
|
||||||
client.get(url_string(query="force error"))
|
|
||||||
set_rollback_mock.assert_not_called()
|
|
||||||
|
|
||||||
finally:
|
|
||||||
connection.settings_dict["ATOMIC_MUTATIONS"] = old_atomic_mutations
|
|
||||||
connection.settings_dict["ATOMIC_REQUESTS"] = old_atomic_requests
|
|
||||||
graphene_settings.ATOMIC_MUTATIONS = old_graphene_atomic_mutations
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user