try:
    from django.apps import AppConfig
except ImportError:
    AppConfig = object


class SelectableConfig(AppConfig):
    """App configuration for django-selectable."""

    name = 'selectable'

    def ready(self):
        self.module.registry.autodiscover()

try:
    from django.apps import AppConfig
except ImportError:
    AppConfig = object


class SelectableConfig(AppConfig):
    """App configuration for django-selectable."""

    name = 'selectable'

    def ready(self):
        from . import registry
        registry.autodiscover()

Update auto-registration to work while running the tests.
Update auto-registration to work while running the tests.

  try:
      from django.apps import AppConfig
  except ImportError:
      AppConfig = object
  
  
  class SelectableConfig(AppConfig):
      """App configuration for django-selectable."""
  
      name = 'selectable'
  
      def ready(self):
+         from . import registry
-         self.module.registry.autodiscover()
+         registry.autodiscover()
  
Update auto-registration to work while running the tests.
## Code Before:
try:
    from django.apps import AppConfig
except ImportError:
    AppConfig = object


class SelectableConfig(AppConfig):
    """App configuration for django-selectable."""

    name = 'selectable'

    def ready(self):
        self.module.registry.autodiscover()

## Instruction:
Update auto-registration to work while running the tests.
## Code After:
try:
    from django.apps import AppConfig
except ImportError:
    AppConfig = object


class SelectableConfig(AppConfig):
    """App configuration for django-selectable."""

    name = 'selectable'

    def ready(self):
        from . import registry
        registry.autodiscover()
