#NEWLINE# def test_expand_uri_elastic_document_doesnt_expand_canonical_uris( self , postgres_enabled , models ) : #NEWLINE# #INDENT# postgres_enabled . return_value = False #NEWLINE# request = DummyRequest ( ) #NEWLINE# document = models . elastic . Document . get_by_uri . return_value #NEWLINE# type ( document ) . document_uris = uris = mock . PropertyMock ( ) #NEWLINE# uris . return_value = [ mock . Mock ( uri = 'http://foo.com/' ) , mock . Mock ( uri = 'http://bar.com/' ) , mock . Mock ( uri = 'http://example.com/' , type = 'rel-canonical' ) ] #NEWLINE# assert ( storage . expand_uri ( uris , 'http://example.com/' ) == [ 'http://example.com/' ] )