vendredi 14 juin 2019

How to say "is not equal" in test ? Assert is not equal

I am testing my code in django and i have a case where i want to test if it is NOT equal. How can i do that ?

i am using the doc from django here : https://docs.djangoproject.com/fr/2.2/topics/testing/tools/

Another example in react we have ".not" to say not equal.

I tried with '.not'

class SimpleTest(TestCase):
    def test_details(self):
        response = self.client.get('/customer/details/')
        self.assertEqual(response.status_code, 200).not()

I expected to have one condition who test the no egality between my variable and my status code.

Thank for your help.

Aucun commentaire:

Enregistrer un commentaire