Reputation: 1402
Not sure what these test errors are in Django when I try running:
python manage.py test --settings=core.settings.test
Tests in each django app failing with:
Error in shepard.core.tests.test_exampleapp
TypeError: Test loader returned an un-runnable object. Is
"shepard.core.tests.test_authorization" importable from your current location?
Maybe you forgot an __init__.py in your directory? Unrunnable object looks like:
None of type <class 'NoneType'> with dir ['__bool__', '__class__', '__delattr__',
'__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__',
'__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__',
'__subclasshook__']
UPDATED
With good config in the test.py this still returns the unrunnable object error. Any ideas most welcome, I am a Django noob :)
core/settings/test.py:
ENVIRONMENT = "test"
DATABASES = {
"default": {
...
}
}
AUTH.update(
{"gateway": "DummyAuthorizationGateway",
"permissions": "DummyPermissionsGateway"}
)
LOGGING["loggers"] = {}
REST_FRAMEWORK = {
"DATETIME_FORMAT": "%Y-%m-%dT%H:%M",
"DEFAULT_THROTTLE_CLASSES": (
"rest_framework.throttling.AnonRateThrottle",
"rest_framework.throttling.UserRateThrottle",
"rest_framework.throttling.ScopedRateThrottle",
),
"DEFAULT_THROTTLE_RATES": {"anon": "10/minute", "user":
"120/minute"},
"DEFAULT_RENDERER_CLASSES":
("rest_framework.renderers.JSONRenderer",),
"DEFAULT_PERMISSION_CLASSES":
("rest_framework.permissions.IsAuthenticated",),
"DEFAULT_AUTHENTICATION_CLASSES": (
"oauth2_provider.contrib.rest_framework.OAuth2Authentication",
),
"DEFAULT_PAGINATION_CLASS": "core.pagination.IntegerPagination",
"PAGE_SIZE": 10,
}
File structure looks like below.
├── shepard
├── clients
├── tests
├── __init__.py
├── test_file_1.py
├── events
├── core
├── settings
├── test.py
├── dev.py
├── manage.py
Upvotes: 0
Views: 143