tests/test_models/test_base_model.py
def testSave(self):
        """ This tests Checks if save method updates the public instance
        attribute updated_at """

        self.my_model.first_name = "First"
        self.my_model.save()

        self.assertIsInstance(self.my_model.id, str)
        self.assertIsInstance(self.my_model.created_at, datetime.datetime)
        self.assertIsInstance(self.my_model.updated_at, datetime.datetime)

        first_dict = self.my_model.to_dict()

        self.my_model.first_name = "Second"
        self.my_model.save()
        sec_dict = self.my_model.to_dict()

        self.assertEqual(first_dict['created_at'], sec_dict['created_at'])
        self.assertNotEqual(first_dict['updated_at'], sec_dict['updated_at'])
 This tests Checks if save method updates the public instance
        attribute updated_at 
This tests Checks if save method updates the public instance
attribute updated_at
This tests Checks if save method updates the public instance attribute updated_at
def testSave(self):
        self.my_model.first_name = "First"
        self.my_model.save()
        self.assertIsInstance(self.my_model.id, str)
        self.assertIsInstance(self.my_model.created_at, datetime.datetime)
        self.assertIsInstance(self.my_model.updated_at, datetime.datetime)
        first_dict = self.my_model.to_dict()
        self.my_model.first_name = "Second"
        self.my_model.save()
        sec_dict = self.my_model.to_dict()
        self.assertEqual(first_dict['created_at'], sec_dict['created_at'])
        self.assertNotEqual(first_dict['updated_at'], sec_dict['updated_at'])
def testSave ( self ) : self . my_model . first_name = "First" self . my_model . save ( ) self . assertIsInstance ( self . my_model . id , str ) self . assertIsInstance ( self . my_model . created_at , datetime . datetime ) self . assertIsInstance ( self . my_model . updated_at , datetime . datetime ) first_dict = self . my_model . to_dict ( ) self . my_model . first_name = "Second" self . my_model . save ( ) sec_dict = self . my_model . to_dict ( ) self . assertEqual ( first_dict [ 'created_at' ] , sec_dict [ 'created_at' ] ) self . assertNotEqual ( first_dict [ 'updated_at' ] , sec_dict [ 'updated_at' ] )
This tests Checks if save method updates the public instance
attribute updated_at
This tests Checks if save method updates the public instance attribute updated_at
""" This tests Checks if save method updates the public instance
        attribute updated_at """
self