def test_get_item_id_calls_the_field_if_callable(self): f = Feature('foo', 'bar') class Foo(object): def bar(self): return 'bazz' f.get_item_id(Foo()) | should.eql('bazz')
def test_get_item_id_casts_to_string(self): f = Feature('foo') class Foo(object): def __str__(self): return 'bar' f.get_item_id(Foo()) | should.eql('bar')
def test_field_can_be_none(self): f = Feature('foo') f.get_item_id('bar') | should.eql('bar')