Module ImportFrom alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr keyword Str keyword ListLoad Str keyword NameLoad keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assert CompareEq AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr keyword Str keyword ListLoad Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr keyword Str keyword ListLoad Str keyword NameLoad keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assert CompareEq AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assert CompareIs AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Assign NameStore Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr ListLoad Str Str Assert CompareEq Call AttributeLoad NameLoad attr Num Assert CompareEq Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr keyword Str keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr ListLoad Str Assert CompareEq Call AttributeLoad NameLoad attr Num decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr keyword Str keyword Str keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword Str keyword Str keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str ListLoad Str Str Assert CompareEq Call AttributeLoad NameLoad attr Num Assert CompareEq Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr keyword Str keyword Str keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str ListLoad Str Assert CompareEq Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Assert Call NameLoad NameLoad AttributeLoad NameLoad attr Assert CompareEq Call NameLoad AttributeLoad NameLoad attr Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assert CompareEq AttributeLoad NameLoad attr Str Assert CompareEq AttributeLoad NameLoad attr Str Assert CompareEq AttributeLoad NameLoad attr Str decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assert CompareEq AttributeLoad NameLoad attr NameLoad Assert CompareEq AttributeLoad NameLoad attr NameLoad Assert CompareEq Call NameLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr attr Num Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Assign NameStore Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword Str keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword Call NameLoad keyword Call NameLoad Assign NameStore SubscriptLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr attr Index Num Assert CompareEq AttributeLoad NameLoad attr NameLoad Assert CompareEq AttributeLoad NameLoad attr NameLoad Assert CompareEq AttributeLoad NameLoad attr NameLoad Assert CompareEq AttributeLoad NameLoad attr NameLoad Assert CompareEq AttributeLoad NameLoad attr NameLoad Assert CompareGt AttributeLoad NameLoad attr NameLoad Assert CompareGt AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr keyword Call NameLoad Assign AttributeStore AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr attr NameLoad Expr Call AttributeLoad NameLoad attr keyword Call NameLoad keyword Str keyword Str keyword Str keyword NameLoad keyword Call NameLoad keyword Call NameLoad keyword Call NameLoad Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad Str decorator_list AttributeLoad NameLoad attr decorator_list Call AttributeLoad AttributeLoad NameLoad attr attr Str ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Assign NameStore Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr keyword NameLoad keyword Str keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assign NameStore SubscriptLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr attr Index Num Assert CompareEq AttributeLoad NameLoad attr NameLoad Assert CompareEq AttributeLoad NameLoad attr NameLoad Assert CompareEq AttributeLoad NameLoad attr NameLoad Assert CompareEq AttributeLoad NameLoad attr NameLoad Assert CompareEq AttributeLoad NameLoad attr NameLoad Assert CompareEq AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword Str keyword Call AttributeLoad NameLoad attr keyword Call NameLoad keyword NameLoad Assert CompareEq AttributeLoad NameLoad attr Str Assert CompareEq AttributeLoad NameLoad attr NameLoad Assert CompareEq AttributeLoad NameLoad attr NameLoad Str Assert CompareEq AttributeLoad NameLoad attr NameLoad Str Assert CompareEq Call NameLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr attr Num Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign NameStore Call NameLoad keyword NameLoad Assign AttributeStore AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr attr NameLoad Expr Call AttributeLoad NameLoad attr keyword Call NameLoad keyword Str keyword Str keyword Str keyword NameLoad keyword Call NameLoad keyword Call NameLoad Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad Str decorator_list AttributeLoad NameLoad attr decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assert CompareEq NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assert CompareIs Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assert CompareEq Call NameLoad AttributeLoad NameLoad attr Num Assert CompareEq Call NameLoad AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assert CompareEq Call NameLoad AttributeLoad NameLoad attr Num Assert CompareEq Call NameLoad AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr keyword ListLoad Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword ListLoad Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr keyword ListLoad Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword ListLoad Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Return TupleLoad NameLoad NameLoad decorator_list AttributeLoad NameLoad attr decorator_list Call AttributeLoad AttributeLoad NameLoad attr attr Str FunctionDef arguments args defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args defaults body Return BinOpSub Call NameLoad Call AttributeLoad NameLoad attr keyword Num decorator_list FunctionDef arguments args defaults body Expr Str ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Pass decorator_list FunctionDef arguments args NameParam NameParam defaults body Pass decorator_list decorator_list Return Call AttributeLoad NameLoad attr keyword Call NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Return Call AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults NameLoad body ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list Return Call AttributeLoad NameLoad attr keyword Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad Str decorator_list AttributeLoad NameLoad attr
N/A __future__ unicode_literals N/A datetime N/A mock N/A pytest h db h.api.models document TestDocumentTitle N/A object N/A test_it_returns_the_value_of_the_one_title_DocumentMeta N/A N/A self N/A N/A N/A When there's only one DocumentMeta it should return its title. N/A doc N/A N/A document Document N/A N/A N/A document DocumentMeta type title value N/A The Title document doc claimant http://example.com N/A N/A N/A N/A db Session add doc N/A N/A N/A N/A db Session flush N/A N/A N/A doc title The Title N/A test_it_returns_the_value_of_the_first_title_DocumentMeta N/A N/A self N/A N/A N/A doc N/A N/A document Document N/A N/A N/A document DocumentMeta type title value N/A The US Title document doc claimant http://example.com N/A N/A N/A document DocumentMeta type title value N/A The UK Title document doc claimant http://example.co.uk N/A N/A N/A N/A db Session add doc N/A N/A N/A N/A db Session flush N/A N/A N/A doc title The US Title N/A test_it_returns_None_if_there_are_no_title_DocumentMetas N/A N/A self N/A N/A N/A doc N/A N/A document Document N/A N/A N/A document DocumentMeta type other value something document doc claimant http://example.com N/A N/A N/A N/A db Session add doc N/A N/A N/A N/A db Session flush N/A N/A N/A doc title None N/A N/A TestDocumentFindByURIs N/A object N/A test_with_one_matching_Document N/A N/A self N/A N/A N/A document1 N/A N/A document Document N/A uri1 https://de.wikipedia.org/wiki/Hauptseite N/A N/A N/A N/A document1 document_uris append N/A N/A document DocumentURI claimant uri1 uri uri1 N/A document2 N/A N/A document Document N/A uri2 https://en.wikipedia.org/wiki/Main_Page N/A N/A N/A N/A document2 document_uris append N/A N/A document DocumentURI claimant uri2 uri uri2 N/A uri3 https://en.wikipedia.org N/A N/A N/A N/A document2 document_uris append N/A N/A document DocumentURI claimant uri3 uri uri2 N/A N/A N/A N/A db Session add_all N/A document1 document2 N/A N/A N/A N/A db Session flush N/A actual N/A N/A N/A document Document find_by_uris N/A db Session N/A https://en.wikipedia.org/wiki/Main_Page https://m.en.wikipedia.org/wiki/Main_Page N/A N/A N/A N/A actual count 1 N/A N/A N/A N/A actual first document2 N/A test_no_matches N/A N/A self N/A N/A N/A document_ N/A N/A document Document N/A N/A N/A N/A document_ document_uris append N/A N/A document DocumentURI claimant https://en.wikipedia.org/wiki/Main_Page uri https://en.wikipedia.org/wiki/Main_Page N/A N/A N/A N/A db Session add document_ N/A N/A N/A N/A db Session flush N/A actual N/A N/A N/A document Document find_by_uris N/A db Session N/A https://de.wikipedia.org/wiki/Hauptseite N/A N/A N/A N/A actual count 0 N/A N/A TestDocumentFindOrCreateByURIs N/A object N/A test_with_one_existing_Document N/A N/A self N/A N/A N/A 
        When there's one matching Document it should return that Document.

        When searching with two URIs that match two DocumentURIs that both
        point to the same Document, it should return that Document.

         N/A document_ N/A N/A document Document N/A docuri1 N/A N/A document DocumentURI claimant https://en.wikipedia.org/wiki/Main_Page uri https://en.wikipedia.org/wiki/Main_Page document document_ N/A docuri2 N/A N/A document DocumentURI claimant https://en.wikipedia.org/wiki/http/en.m.wikipedia.org/wiki/Main_Page uri https://en.wikipedia.org/wiki/Main_Page document document_ N/A N/A N/A N/A db Session add docuri1 N/A N/A N/A N/A db Session add docuri2 N/A N/A N/A N/A db Session flush N/A actual N/A N/A N/A document Document find_or_create_by_uris N/A db Session https://en.wikipedia.org/wiki/Main_Page N/A https://en.wikipedia.org/wiki/http/en.m.wikipedia.org/wiki/Main_Page https://m.en.wikipedia.org/wiki/Main_Page N/A N/A N/A N/A actual count 1 N/A N/A N/A N/A actual first document_ N/A test_with_no_existing_documents N/A N/A self N/A N/A N/A When there are no matching Documents it creates and returns one. N/A document_ N/A N/A document Document N/A docuri N/A N/A document DocumentURI claimant https://en.wikipedia.org/wiki/Main_Page uri https://en.wikipedia.org/wiki/Main_Page document document_ N/A N/A N/A N/A db Session add docuri N/A N/A N/A N/A db Session flush N/A documents N/A N/A N/A document Document find_or_create_by_uris N/A db Session https://en.wikipedia.org/wiki/Pluto N/A https://m.en.wikipedia.org/wiki/Pluto N/A N/A N/A N/A documents count 1 N/A actual N/A N/A documents first N/A N/A isinstance actual N/A document Document N/A N/A N/A len N/A actual document_uris 1 N/A docuri N/A N/A actual document_uris N/A 0 N/A N/A N/A docuri claimant https://en.wikipedia.org/wiki/Pluto N/A N/A N/A docuri uri https://en.wikipedia.org/wiki/Pluto N/A N/A N/A docuri type self-claim N/A N/A TestCreateOrUpdateDocumentURI N/A object N/A test_it_updates_the_existing_DocumentURI_if_there_is_one N/A N/A self N/A N/A N/A claimant http://example.com/example_claimant.html N/A uri http://example.com/example_uri.html N/A type_ self-claim N/A content_type None N/A document_ N/A N/A document Document N/A created N/A yesterday N/A updated N/A yesterday N/A document_uri N/A N/A document DocumentURI claimant claimant uri uri type type_ content_type content_type document document_ created created updated updated N/A N/A N/A N/A db Session add document_uri N/A now_ N/A now N/A N/A N/A document create_or_update_document_uri session N/A db Session claimant claimant uri uri type type_ content_type content_type document document_ created now_ updated now_ N/A N/A N/A document_uri created created N/A N/A N/A document_uri updated now_ N/A N/A N/A len N/A N/A N/A N/A N/A db Session query N/A document DocumentURI all 1 It shouldn't have added any new objects to the db N/A test_it_creates_a_new_DocumentURI_if_there_is_no_existing_one N/A N/A self N/A N/A N/A claimant http://example.com/example_claimant.html N/A uri http://example.com/example_uri.html N/A type_ self-claim N/A content_type None N/A document_ N/A N/A document Document N/A created N/A yesterday N/A updated N/A yesterday N/A N/A N/A N/A db Session add N/A N/A document DocumentURI claimant claimant uri uri type type_ content_type different document document_ created created updated updated N/A N/A N/A document create_or_update_document_uri session N/A db Session claimant claimant uri uri type type_ content_type content_type document document_ created N/A now updated N/A now N/A document_uri N/A N/A N/A N/A N/A N/A db Session query N/A document DocumentURI all N/A -1 N/A N/A N/A document_uri claimant claimant N/A N/A N/A document_uri uri uri N/A N/A N/A document_uri type type_ N/A N/A N/A document_uri content_type content_type N/A N/A N/A document_uri document document_ N/A N/A N/A document_uri created created N/A N/A N/A document_uri updated updated N/A test_it_logs_a_warning_if_document_ids_differ N/A N/A self log DocumentURI N/A N/A N/A 
        It should log a warning on Document objects mismatch.

        If there's an existing DocumentURI and its .document property is
        different to the given document it shoulg log a warning.

         N/A existing_document_uri N/A N/A mock Mock document N/A mock_document N/A N/A N/A N/A N/A N/A DocumentURI query filter return_value first return_value existing_document_uri N/A N/A N/A document create_or_update_document_uri session N/A mock_db_session claimant http://example.com/example_claimant.html uri http://example.com/example_uri.html type self-claim content_type None document N/A mock_document created N/A now updated N/A now N/A N/A N/A N/A log warn call_count 1 N/A DocumentURI N/A N/A self patch N/A N/A N/A N/A patch h.api.models.document.DocumentURI N/A N/A pytest fixture N/A N/A N/A N/A pytest mark usefixtures log TestCreateOrUpdateDocumentMeta N/A object N/A test_it_creates_a_new_DocumentMeta_if_there_is_no_existing_one N/A N/A self N/A N/A N/A claimant http://example.com/claimant N/A type_ title N/A value the title N/A document_ N/A N/A document Document N/A created N/A yesterday N/A updated N/A now N/A N/A N/A N/A db Session add N/A N/A document DocumentMeta claimant claimant type different value value document document_ created created updated updated N/A N/A N/A document create_or_update_document_meta session N/A db Session claimant claimant type type_ value value document document_ created created updated updated N/A document_meta N/A N/A N/A N/A N/A N/A db Session query N/A document DocumentMeta all N/A -1 N/A N/A N/A document_meta claimant claimant N/A N/A N/A document_meta type type_ N/A N/A N/A document_meta value value N/A N/A N/A document_meta document document_ N/A N/A N/A document_meta created created N/A N/A N/A document_meta updated updated N/A test_it_updates_an_existing_DocumentMeta_if_there_is_one N/A N/A self N/A N/A N/A claimant http://example.com/claimant N/A type_ title N/A value the title N/A document_ N/A N/A document Document N/A created N/A yesterday N/A updated N/A now N/A document_meta N/A N/A document DocumentMeta claimant claimant type type_ value value document document_ created created updated updated N/A N/A N/A N/A db Session add document_meta N/A new_updated N/A now N/A N/A N/A document create_or_update_document_meta session N/A db Session claimant claimant type type_ value new value document N/A N/A document Document created N/A now updated new_updated N/A N/A N/A document_meta value new value N/A N/A N/A document_meta updated new_updated N/A N/A N/A document_meta created created It shouldn't update created N/A N/A N/A document_meta document document_ It shouldn't update document N/A N/A N/A len N/A N/A N/A N/A N/A db Session query N/A document DocumentMeta all 1 It shouldn't have added any new objects to the db N/A test_it_logs_a_warning N/A N/A self DocumentMeta log N/A N/A N/A 
        It should warn on document mismatches.

        It should warn if there's an existing DocumentMeta with a different
        Document.

         N/A document_one N/A mock_document N/A document_two N/A mock_document N/A existing_document_meta N/A mock_document_meta document document_one N/A N/A N/A N/A N/A N/A DocumentMeta query filter return_value one_or_none return_value existing_document_meta N/A N/A N/A document create_or_update_document_meta session N/A mock_db_session claimant http://example.com/claimant type title value new value document document_two created N/A yesterday updated N/A now N/A N/A N/A N/A log warn call_count 1 N/A DocumentMeta N/A N/A self patch N/A N/A N/A N/A patch h.api.models.document.DocumentMeta N/A N/A pytest fixture N/A TestMergeDocuments N/A object N/A test_merge_documents_returns_master N/A N/A self merge_data N/A N/A N/A N/A master _ merge_data N/A merged_master N/A N/A document merge_documents N/A db Session merge_data N/A N/A merged_master master N/A test_merge_documents_deletes_duplicate_documents N/A N/A self merge_data N/A N/A N/A N/A _ duplicate merge_data N/A N/A N/A document merge_documents N/A db Session merge_data N/A N/A N/A N/A db Session flush N/A N/A N/A N/A N/A N/A document Document query get N/A duplicate id None N/A test_merge_documents_rewires_document_uris N/A N/A self merge_data N/A N/A N/A N/A master duplicate merge_data N/A N/A N/A document merge_documents N/A db Session merge_data N/A N/A N/A N/A db Session flush N/A N/A N/A len N/A master document_uris 2 N/A N/A N/A len N/A duplicate document_uris 0 N/A test_merge_documents_rewires_document_meta N/A N/A self merge_data N/A N/A N/A N/A master duplicate merge_data N/A N/A N/A document merge_documents N/A db Session merge_data N/A N/A N/A N/A db Session flush N/A N/A N/A len N/A master meta 2 N/A N/A N/A len N/A duplicate meta 0 N/A merge_data N/A N/A self request N/A N/A N/A master N/A N/A document Document document_uris N/A N/A N/A document DocumentURI claimant https://en.wikipedia.org/wiki/Main_Page uri https://en.wikipedia.org/wiki/Main_Page type self-claim meta N/A N/A N/A document DocumentMeta claimant https://en.wikipedia.org/wiki/Main_Page type title value Wikipedia, the free encyclopedia N/A duplicate N/A N/A document Document document_uris N/A N/A N/A document DocumentURI claimant https://m.en.wikipedia.org/wiki/Main_Page uri https://en.wikipedia.org/wiki/Main_Page type rel-canonical meta N/A N/A N/A document DocumentMeta claimant https://m.en.wikipedia.org/wiki/Main_Page type title value Wikipedia, the free encyclopedia N/A N/A N/A N/A db Session add_all N/A master duplicate N/A N/A N/A N/A db Session flush N/A N/A master duplicate N/A N/A pytest fixture N/A N/A N/A N/A pytest mark usefixtures merge_data now N/A N/A N/A N/A N/A N/A N/A N/A datetime datetime now N/A yesterday N/A N/A N/A N/A N/A N/A N/A now N/A N/A datetime timedelta days 1 N/A mock_db_session N/A N/A N/A N/A N/A Return a mock db session object. DB N/A object N/A add N/A N/A self obj N/A N/A N/A N/A query N/A N/A self cls N/A N/A N/A N/A N/A N/A N/A N/A mock Mock spec N/A DB N/A mock_document N/A N/A N/A N/A N/A Return a mock Document object. N/A N/A N/A mock Mock spec N/A N/A document Document N/A mock_document_meta N/A N/A document N/A None N/A DocumentMeta N/A object N/A __init__ N/A N/A self N/A N/A N/A N/A self type None N/A N/A self value None N/A N/A self created None N/A N/A self updated None N/A N/A self document document N/A N/A self id None N/A N/A self document_id None N/A N/A N/A N/A N/A mock Mock spec N/A DocumentMeta N/A log N/A N/A patch N/A N/A N/A N/A patch h.api.models.document.log N/A N/A pytest fixture