python - Django test object is not callable -


I am trying to create a test below and I get this message:

On this line: self.stock.expiry_date (tomorrow)

Test

  def test_stock_passed_expiration (self): "" 'true' returned when 'stock' is passed on the expiry date. "Yesterday" = date today () - timeliness (days = 1) itself.expirary_date (tomorrow) auto.assetqual (auto.stack.sc), true)  

< Strong> model:

  class stock (Models.Model): product = model.external (product, related_name = "stock") expiry_date = models.DateTimeField (default = timezone. Nana) DEF is EXPIRED (self): if timezone.none> Self.expiry_date: return True return False 

You have

  self.stock.expiry_date (tomorrow)  

but its Meaning

  self.stock.expiry_date = tomorrow  

to treat you self.stock.expiry_date (a datetime object) , As if it was a function that leads to that error message.


Comments