Comments (9)
I get this error:
Traceback (most recent call last):
File "./manage.py", line 13, in <module>
from django.contrib.auth.tests import custom_user
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/contrib/auth/tests/custom_user.py", line 2, in <module>
from django.contrib.auth.models import (
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/contrib/auth/models.py", line 16, in <module>
from django.contrib.contenttypes.models import ContentType
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/contrib/contenttypes/models.py", line 140, in <module>
class ContentType(models.Model):
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/db/models/base.py", line 105, in __new__
warnings.warn(msg, RemovedInDjango19Warning, stacklevel=2)
django.utils.deprecation.RemovedInDjango19Warning: Model class django.contrib.contenttypes.models.ContentType doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
This is because our manage.py is importing models (225e89f) before django is set up. I added a django.setup()
line in manage.py to see if that would do anything, and now I get this error:
Traceback (most recent call last):
File "./manage.py", line 19, in <module>
execute_from_command_line(sys.argv)
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 50, in run_from_argv
super(Command, self).run_from_argv(argv)
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **options.__dict__)
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 71, in execute
super(Command, self).execute(*args, **options)
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
output = self.handle(*args, **options)
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 88, in handle
failures = test_runner.run_tests(test_labels)
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/test/runner.py", line 147, in run_tests
old_config = self.setup_databases()
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/test/runner.py", line 109, in setup_databases
return setup_databases(self.verbosity, self.interactive, **kwargs)
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/test/runner.py", line 299, in setup_databases
serialize=connection.settings_dict.get("TEST", {}).get("SERIALIZE", True),
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/db/backends/creation.py", line 385, in create_test_db
self.connection._test_serialized_contents = self.serialize_db_to_string()
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/db/backends/creation.py", line 421, in serialize_db_to_string
serializers.serialize("json", get_objects(), indent=None, stream=out)
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/core/serializers/__init__.py", line 128, in serialize
s.serialize(queryset, **options)
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/core/serializers/base.py", line 52, in serialize
for obj in queryset:
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/db/backends/creation.py", line 417, in get_objects
for obj in queryset.iterator():
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/db/models/query.py", line 265, in iterator
for row in compiler.results_iter():
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 700, in results_iter
for rows in self.execute_sql(MULTI):
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
cursor.execute(sql, params)
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File ".virtualenvs/tmp-493b68aa9cd4c227/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 485, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: auth_customuser
from django-authtools.
Why are those lines there in the first place?
You could potentially sidestep this by creating an app that is only installed during test runs and put that monkepatch code in the models.py
file. Then it'll still run during setup.
from django-authtools.
They're needed to run the tests on django 1.6. I don't remember exactly why, maybe @rockymeza does.
from django-authtools.
It was issue #12
from django-authtools.
I profoundly do not understand what happened in #12.
from django-authtools.
I also get the auth_customuser error and I don't know where it's coming from. I think that maybe it's time we stop relying on the built-in tests.
from django-authtools.
My stuff is in the 1.7-support branch, but I'm stuck on the same error as @gavinwahl was.
from django-authtools.
The django.contrib.auth tests have their own models, but where are the migrations? How do those models get created in django's tests? I think that part is just getting skipped when we run the tests.
from django-authtools.
@gavinwahl @rockymeza This models get created without migrations in Django tests à la syncdb
. I spend 2 hours reading and understanding django's code. I finally found the obvious line. I committed a fix in 1.7-support: 280c5dd .
You can run the tests, but they don't pass. I'm still working on it.
from django-authtools.
Related Issues (20)
- Use with django-axes not supported HOT 2
- Request object not passed in login HOT 1
- Support Django 3.0 HOT 7
- Signature of create_superuser() not allways compatible with Django's own HOT 1
- AbstractEmailUser does not normalize emails HOT 2
- Docs out of date: `schemamigration` does not exist anymore HOT 1
- Handling of SMTPRecipientsRefused exception
- Project continuity HOT 3
- Django >= 3.2 creating new migrations HOT 1
- CaseInsensitiveEmailUserCreationForm does not do anything if the USERNAME_FIELD is not username HOT 7
- New stable release HOT 3
- Change password link broken again HOT 1
- I think pip installation doesn't install lastversion.
- How to sign in with both username or email using django-authtools? HOT 1
- Authtool not recognized in AWS deployment HOT 1
- Authtools' user model doesn't work with utf8mb4 on MariaDB/MySQL HOT 1
- User password change link HOT 2
- Use a namespace? HOT 1
- BetterReadOnlyPasswordHashWidget is broken for view only users
- is_authenticated() no longer supported in Django 2.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-authtools.