File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
openwisp_controller/config/tests Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -544,17 +544,16 @@ def test_changed_checked_fields_no_duplicates(self):
544544 def test_deferred_fields_populated_correctly (self ):
545545 device = self ._create_device (
546546 name = "deferred-test" ,
547- last_ip = "172.16.0.1" ,
548547 management_ip = "10.0.0.1" ,
549548 )
550549 # Load the instance with deferred fields omitted
551550 device = Device .objects .only ("id" ).get (pk = device .pk )
552- device .last_ip = "172.16.1.1 "
553- # Populate initial values for checked fields
554- device ._check_changed_fields ()
551+ device .management_ip = "10.0.0.55 "
552+ # Saving the device object will populate the deferred fields
553+ device .save ()
555554 # Ensure `_initial_<field>` contains the actual value, not the field name
556- self .assertEqual (getattr (device , "_initial_last_ip " ), "172.16 .0.1 " )
557- self .assertNotEqual (getattr (device , "_initial_last_ip " ), "last_ip " )
555+ self .assertEqual (getattr (device , "_initial_management_ip " ), "10.0 .0.55 " )
556+ self .assertNotEqual (getattr (device , "_initial_management_ip " ), "management_ip " )
558557
559558 def test_exceed_organization_device_limit (self ):
560559 org = self ._get_org ()
You can’t perform that action at this time.
0 commit comments