A
A
Alexey Belov2018-02-08 19:37:43
Django
Alexey Belov, 2018-02-08 19:37:43

How to write tests for methods of this manager?

How to write tests in pytest?

class OperatorLogManager(models.Manager):
    def active(self):
       """Mark object as active"""
        return self.filter(is_delete=False)

     def get_by_user_id(self, id):
          return self.active().filter(pk=id)

     def get_by_client_id(self, client_uid):
          return self.active().filter(client_uid=client_uid)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question