Skip to content
This repository has been archived by the owner on Nov 16, 2018. It is now read-only.

add example for how to test functions on the Type classes #4

Open
mbrochh opened this issue Jul 7, 2017 · 0 comments
Open

add example for how to test functions on the Type classes #4

mbrochh opened this issue Jul 7, 2017 · 0 comments

Comments

@mbrochh
Copy link
Owner

mbrochh commented Jul 7, 2017

Something like this:

        from graphene.test import Client
        c = Client(root_schema)
        resp = c.execute('''
            {
                allSizesForProduct(productPk: 1) {
                    pk, inCm
                }
            }
        ''')
        res = resp['data']['allSizesForProduct'][0]
        self.assertEqual(res['pk'], 1, msg=(
            'Should return the pk of the item'))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant