          for app_label, migration_name in self.graph.leaf_nodes():
              if app_label in seen_apps:
                  conflicting_apps.add(app_label)
              seen_apps.setdefault(app_label, set()).add(migration_name)
          return {app_label: seen_apps[app_label] for app_label in conflicting_apps}
  
      def project_state(self, nodes=None, at_end=True):
          """
          Return a ProjectState object representing the most recent state
          that the loaded migrations represent.
 
</s> remove         with self.assertRaisesMessage(CommandError, "Conflicting migrations detected"):
 </s> add         msg = (
            "Conflicting migrations detected; multiple leaf nodes in the "
            "migration graph: (0002_conflicting_second, 0002_second in "
            "migrations).\n"
            "To fix them run 'python manage.py makemigrations --merge'"
        )
        with self.assertRaisesMessage(CommandError, msg): </s> remove         self.assertIn('0002_second', exception_message)
        self.assertIn('0002_conflicting_second', exception_message)
        self.assertIn('in migrations', exception_message)
        self.assertIn("To fix them run 'python manage.py makemigrations --merge'", exception_message)
 </s> add  </s> remove         exception_message = str(context.exception)
        self.assertIn(
            'Conflicting migrations detected; multiple leaf nodes '
            'in the migration graph:',
            exception_message
 </s> add         self.assertEqual(
            str(context.exception),
            "Conflicting migrations detected; multiple leaf nodes in the "
            "migration graph: (0002_conflicting_second, 0002_second in "
            "migrations).\n"
            "To fix them run 'python manage.py makemigrations --merge'" </s> remove                 '    - create model book\n',
                val
 </s> add                 '    - create model book\n' </s> remove                 '    - create model something\n',
                val
            )
            self.assertIn(
 </s> add                 '    - create model something\n'
        return {app_label: sorted(seen_apps[app_label]) for app_label in conflicting_apps}
          for app_label, migration_name in self.graph.leaf_nodes():
              if app_label in seen_apps:
                  conflicting_apps.add(app_label)
              seen_apps.setdefault(app_label, set()).add(migration_name)
        return {app_label: sorted(seen_apps[app_label]) for app_label in conflicting_apps}
  
      def project_state(self, nodes=None, at_end=True):
          """
          Return a ProjectState object representing the most recent state
          that the loaded migrations represent.
keep keep keep keep replace keep keep keep keep keep
 Sorted conflicting migrations by names. 
django/db/migrations/loader.py