diff --git a/server/books/tests/test_module_mutations.py b/server/books/tests/test_module_mutations.py index 5eb3db58..ac825fec 100644 --- a/server/books/tests/test_module_mutations.py +++ b/server/books/tests/test_module_mutations.py @@ -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)