示例#1
0
 def test_get_primary_key_compound_key(self):
     # get_primary_key() returns a tuple of all the values in the model
     # instance's primary key when the model uses a compound primary key.
     storm_object = FakeStormCompoundPrimaryKeyClass()
     storm_object.id1 = 1234
     storm_object.id2 = 5678
     self.assertEqual((1234, 5678), get_primary_key(storm_object))
示例#2
0
 def test_get_primary_key_compound_key(self):
     # get_primary_key() returns a tuple of all the values in the model
     # instance's primary key when the model uses a compound primary key.
     storm_object = FakeStormCompoundPrimaryKeyClass()
     storm_object.id1 = 1234
     storm_object.id2 = 5678
     self.assertEqual((1234, 5678), get_primary_key(storm_object))
示例#3
0
 def test_get_primary_key(self):
     # get_primary_key() returns the value of the model instance's primary
     # key.
     storm_object = FakeStormClass()
     storm_object.id = 1234
     self.assertEqual(1234, get_primary_key(storm_object))
示例#4
0
 def test_get_primary_key(self):
     # get_primary_key() returns the value of the model instance's primary
     # key.
     storm_object = FakeStormClass()
     storm_object.id = 1234
     self.assertEqual(1234, get_primary_key(storm_object))