@@ -504,14 +504,14 @@ def test_date():
504504 F .insert1 ((2 , "2019-09-25" ))
505505
506506 new_value = None
507- F .update1 (dict ((F & "id=2" ).proj (). fetch1 (), date = new_value ))
507+ F .update1 (dict ((F & "id=2" ).fetch1 ("KEY" ), date = new_value ))
508508 assert_equal ((F & "id=2" ).fetch1 ("date" ), new_value )
509509
510510 new_value = datetime .date (2019 , 10 , 25 )
511- F .update1 (dict ((F & "id=2" ).proj (). fetch1 (), date = new_value ))
511+ F .update1 (dict ((F & "id=2" ).fetch1 ("KEY" ), date = new_value ))
512512 assert_equal ((F & "id=2" ).fetch1 ("date" ), new_value )
513513
514- F .update1 (dict ((F & "id=2" ).proj (). fetch1 (), date = None ))
514+ F .update1 (dict ((F & "id=2" ).fetch1 ("KEY" ), date = None ))
515515 assert_equal ((F & "id=2" ).fetch1 ("date" ), None )
516516
517517 @staticmethod
@@ -533,20 +533,20 @@ def test_ellipsis():
533533 def test_update_single_key ():
534534 """Test that only one row can be updated"""
535535 TTestUpdate .update1 (
536- dict (TTestUpdate .proj (). fetch1 (), string_attr = "my new string" )
536+ dict (TTestUpdate .fetch1 ("KEY" ), string_attr = "my new string" )
537537 )
538538
539539 @staticmethod
540540 @raises (dj .DataJointError )
541541 def test_update_no_primary ():
542542 """Test that no primary key can be updated"""
543- TTestUpdate .update1 (dict (TTestUpdate .proj (). fetch1 (), primary_key = 2 ))
543+ TTestUpdate .update1 (dict (TTestUpdate .fetch1 ("KEY" ), primary_key = 2 ))
544544
545545 @staticmethod
546546 @raises (dj .DataJointError )
547547 def test_update_missing_attribute ():
548548 """Test that attribute is in table"""
549- TTestUpdate .update1 (dict (TTestUpdate .proj (). fetch1 (), not_existing = 2 ))
549+ TTestUpdate .update1 (dict (TTestUpdate .fetch1 ("KEY" ), not_existing = 2 ))
550550
551551 @staticmethod
552552 def test_update_string_attribute ():
@@ -555,25 +555,25 @@ def test_update_string_attribute():
555555 s = "" .join (
556556 random .choice (string .ascii_uppercase + string .digits ) for _ in range (10 )
557557 )
558- TTestUpdate .update1 (dict (rel .proj (). fetch1 (), string_attr = s ))
558+ TTestUpdate .update1 (dict (rel .fetch1 ("KEY" ), string_attr = s ))
559559 assert_equal (s , rel .fetch1 ("string_attr" ), "Updated string does not match" )
560560
561561 @staticmethod
562562 def test_update_numeric_attribute ():
563563 """Test replacing a string value"""
564564 rel = TTestUpdate () & dict (primary_key = 0 )
565565 s = random .randint (0 , 10 )
566- TTestUpdate .update1 (dict (rel .proj (). fetch1 (), num_attr = s ))
566+ TTestUpdate .update1 (dict (rel .fetch1 ("KEY" ), num_attr = s ))
567567 assert_equal (s , rel .fetch1 ("num_attr" ), "Updated integer does not match" )
568- TTestUpdate .update1 (dict (rel .proj (). fetch1 (), num_attr = None ))
568+ TTestUpdate .update1 (dict (rel .fetch1 ("KEY" ), num_attr = None ))
569569 assert_true (np .isnan (rel .fetch1 ("num_attr" )), "Numeric value is not NaN" )
570570
571571 @staticmethod
572572 def test_update_blob_attribute ():
573573 """Test replacing a string value"""
574574 rel = TTestUpdate () & dict (primary_key = 0 )
575575 s = rel .fetch1 ("blob_attr" )
576- TTestUpdate .update1 (dict (rel .proj (). fetch1 (), blob_attr = s .T ))
576+ TTestUpdate .update1 (dict (rel .fetch1 ("KEY" ), blob_attr = s .T ))
577577 assert_equal (
578578 s .T .shape , rel .fetch1 ("blob_attr" ).shape , "Array dimensions do not match"
579579 )
0 commit comments