This commit is contained in:
Lorenz Padberg 2023-08-23 16:45:00 +02:00
parent be18b2c4c7
commit 678e064cfe
1 changed files with 15 additions and 14 deletions

View File

@ -123,27 +123,28 @@ class NewContentBlockMutationTest(TestCase):
self.assertEqual(content.get('type'), 'image_url_block')
self.assertEqual(content.get('value'), {'url': '/test.png'})
@skip("TODO: Fix this test")
def test_updateLastModuleLevel(self):
self.assertIsNone(self.user.last_module_level, None)
moduleLevel= ModuleLevelFactory(name='1. Lehrjahr')
moduleLevel = ModuleLevelFactory(name='1. Lehrjahr')
moduleLevel1 = ModuleLevelFactory(name='2. Lehrjahr')
mutation = """
mutation ($input: UpdateLastModuleLevelInput!){updateLastModuleLevel(input: $input) {
clientMutationId
user {
username
lastModuleLevel {
name
id
}
}
}}
mutation ($input: UpdateLastModuleLevelInput!) {
updateLastModuleLevel(input: $input) {
clientMutationId
user {
username
lastModuleLevel {
name
id
}
}
}
}
"""
result = self.client.execute(mutation, variables={"input": {"id": moduleLevel1.id}})
module_level_gql_id = to_global_id('ModuleLevelNode', moduleLevel1.pk)
result = self.client.execute(mutation, variables={"input": {"id": module_level_gql_id}})
self.assertIsNone(result.get('errors'))
updated_user = User.objects.get(id=self.user.id)