def test_create_caseversion_existing_user(self):

        # need a user to exist, so the import can find it.
        user = self.F.UserFactory.create(email="sumbudee@mozilla.com")

        result = self.import_data(
            {
                "cases": [
                    {
                        "created_by": "sumbudee@mozilla.com",
                        "name": "Foo",
                        "steps": [{"instruction": "do this"}]
                        }
                    ]
                }
            )

        cv = self.model.CaseVersion.objects.get()
        self.assertEqual(cv.created_by, user)
        self.assertEqual(result.num_cases, 1)
A case with created_by field filled with existing user
dataset/ETHPy150Open mozilla/moztrap/tests/model/library/test_importer.py/ImporterTest.test_create_caseversion_existing_user