def import_cases(self, case_dict_list, force_dupes=False):
        """
        Import the test cases in the data.

        This may include suites and tags that each case belongs to.  If a case
        has no name, it will be skipped.  If a case has no steps, it will
        be imported, but a warning will be given.  All fields are optional
        with the exception of a name.

        Case data should be in this format::

            [
                {
                    "name": "case title",
                    "description": "case description",
                    "tags": ["tag1", "tag2", "tag3"],
                    "suites": ["suite1 name", "suite2 name", "suite3 name"],
                    "created_by": "cdawson@mozilla.com"
                    "steps": [
                        {
                            "instruction": "insruction text",
                            "expected": "expected text"
                        },
                    ]
                }
            ]


        """

        result = ImportResult()

        for new_case in case_dict_list:

            if not "name" in new_case:
                result.warn(
                    ImportResult.SKIP_CASE_NO_NAME,
                    new_case,
                    )
                continue

            # Don't re-import if we have the same case name and Product Version
            if not force_dupes and CaseVersion.objects.filter(
                name=new_case["name"],
                productversion=self.productversion,
                ).exists():

                result.warn(
                    ImportResult.SKIP_CASE_NAME_CONFLICT,
                    new_case,
                    )

                continue

            user = None
            if "created_by" in new_case:
                try:
                    email = new_case["created_by"]
                    user = self.user_cache.get_user(email)

                except User.DoesNotExist:
                    result.warn(
                        ImportResult.WARN_USER_NOT_FOUND,
                        email,
                        )

            # the case looks good so far, but there may be a problem with
            # one of the steps.  So, create a savepoint in case something
            # is inherently wrong with this case, we can roll back to skip
            # it, and still import the rest of the cases.
            sid = transaction.savepoint()

            # create the top-level case object which holds the versions
            case = Case.objects.create(
                product=self.productversion.product,
                idprefix=new_case.get("idprefix", ""),
                )

            # create the case version which holds the details
            caseversion = CaseVersion.objects.create(
                productversion=self.productversion,
                case=case,
                name=new_case["name"],
                description=new_case.get("description", ""),
                user=user,
                )

            # add the steps to this case version
            if new_case in "steps":
                try:
                    self.import_steps(caseversion, new_case["steps"])
                except ValueError as e:
                    result.warn(
                        e.args[0],
                        new_case,
                        )

                    transaction.savepoint_rollback(sid)
                    continue
            else:
                result.warn(
                    ImportResult.WARN_NO_STEPS,
                    caseversion,
                    )

            if "tags" in new_case:
                self.tag_importer.add_names(caseversion, new_case["tags"])

            if "suites" in new_case:
                self.suite_importer.add_names(case, new_case["suites"])

            # case has been created, increment our count for reporting
            result.num_cases += 1

            # this case went ok.  We'll save it as complete in the overall
            # transaction.
            transaction.savepoint_commit(sid)

            # now create the tags and add case versions to them
            self.tag_importer.import_tags()

            # now create the suites and add cases to them
            result.append(self.suite_importer.import_suites())

        return result
dataset/ETHPy150Open mozilla/moztrap/moztrap/model/library/importer.py/CaseImporter.import_cases/swapped operands of `in`