1

I am trying to flexmock a django model object, but when I mock it then also it gives me that object itself. How can I mock it then ?

So there was a model object I created in a method like this

aa = ModelName()

now when I tried to mock it, like this

from flexmock import flexmock
bb = flexmock(aa)

the type of bb is still django model object, it's not flexmock object. How can I mock it successfully ?

mariodev
  • 13,928
  • 3
  • 49
  • 61
NIlesh Sharma
  • 5,445
  • 6
  • 36
  • 53

1 Answers1

0

If you look carefully, the flexmock function is actually modifying the aa object, so it is a partial mock. It has all the necessary methods.

mariodev
  • 13,928
  • 3
  • 49
  • 61