예제 #1
0
def test_expected_documents_find_by_mine_guid_after_insert(db_session):
    mine = MineFactory(mine_expected_documents=BATCH_SIZE)
    mine_guid = mine.mine_guid
    org_expected_documents = MineExpectedDocument.find_by_mine_guid(
        str(mine_guid))

    MineExpectedDocumentFactory(mine=mine)
    new_expected_documents = MineExpectedDocument.find_by_mine_guid(
        str(mine_guid))

    assert len(new_expected_documents) == BATCH_SIZE + 1
    assert all(mine_guid == ned.mine_guid for ned in new_expected_documents)
    assert all(mine_guid == oed.mine_guid for oed in org_expected_documents)
예제 #2
0
def test_expected_documents_find_by_mine_guid_after_insert(test_client, auth_headers):
    org_expected_documents = MineExpectedDocument.find_by_mine_guid(TEST_MINE_GUID)

    expected_document2 = MineExpectedDocument(
        exp_document_guid=uuid.UUID(TEST_EXPECTED_DOCUMENT_GUID2),
        mine_guid=uuid.UUID(TEST_MINE_GUID),
        exp_document_name=TEST_EXPECTED_DOCUMENT_NAME2,
        exp_document_status_code=TEST_EXPECTED_DOCUMENT_STATUS_CODE1,
        **DUMMY_USER_KWARGS)
    expected_document2.save()

    new_expected_documents = MineExpectedDocument.find_by_mine_guid(TEST_MINE_GUID)

    assert len(new_expected_documents) == (len(org_expected_documents) + 1)
    assert all(str(ned.mine_guid) == TEST_MINE_GUID for ned in new_expected_documents)
    assert all(str(oed.mine_guid) == TEST_MINE_GUID for oed in org_expected_documents)
def test_expected_documents_find_by_mine_guid(test_client, auth_headers):
    expected_documents = MineExpectedDocument.find_by_mine_guid(TEST_MINE_GUID)
    assert all(
        str(ed.mine_guid) == TEST_MINE_GUID for ed in expected_documents)
예제 #4
0
def test_expected_documents_find_by_mine_guid(db_session):
    mine_guid = MineFactory(mine_expected_documents=BATCH_SIZE).mine_guid

    expected_documents = MineExpectedDocument.find_by_mine_guid(str(mine_guid))
    assert len(expected_documents) == BATCH_SIZE
    assert all(mine_guid == ed.mine_guid for ed in expected_documents)