

def test_get_doc_counts_per_doc_type(self):
    doc_types = self.migration.doc_types
    self.assertEqual(get_doc_counts_per_doc_type(self.migration.source_db, doc_types), {
        'CommCareUser': 2,
        'CommCareUser-Deleted': 0,
        'Group': 1,
        'Group-Deleted': 1,
    })
    self.assertEqual(get_doc_counts_per_doc_type(self.migration.target_db, doc_types), {
        'CommCareUser': 0,
        'CommCareUser-Deleted': 0,
        'Group': 0,
        'Group-Deleted': 0,
    })
    self.migration.phase_1_bulk_migrate()
    self.assertEqual(get_doc_counts_per_doc_type(self.migration.source_db, doc_types), {
        'CommCareUser': 2,
        'CommCareUser-Deleted': 0,
        'Group': 1,
        'Group-Deleted': 1,
    })
    self.assertEqual(get_doc_counts_per_doc_type(self.migration.target_db, doc_types), {
        'CommCareUser': 2,
        'CommCareUser-Deleted': 0,
        'Group': 1,
        'Group-Deleted': 1,
    })

dataset/ETHPy150Open dimagi/commcare-hq/corehq/doctypemigrations/tests.py TestDocTypeMigrations.test_get_doc_counts_per_doc_type/original