I'm trying to test my mutation according to graphene django documentation. the mutation works with @login_required
decorator and there's a problem because any method of login to test doesn't work. I tried with self.client.login
, self.client.force_login
. I've even made a tokenAuth mutation, and hardcoded some credentials there and it also doesn't work; the user is still Anonymous.
def test_create_member_mutation(self):
response = self.query(
'''
mutation createMember($firstName: String) {
createMember(firstName: $firstName) {
member {
id
}
}
}
''',
op_name='createMember',
variables={'firstName': 'Foo'}
)
self.assertResponseNoErrors(response)