[Django] #33704: Missing migrations in tests

10 views
Skip to first unread message

Django

unread,
May 13, 2022, 2:47:48 AM5/13/22
to django-...@googlegroups.com
#33704: Missing migrations in tests
---------------------------------------------+------------------------
Reporter: Florian Apolloner | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
---------------------------------------------+------------------------
Running
```
./runtests.py --settings=test_postgresql -v2
postgres_tests.test_search.TestRankingAndWeights.test_ranked_custom_weights
--keepdb
```

with the following settings:
```
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "django",
},
"other": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "django2",
},
}

# INSTALLED_APPS = [
# 'postgres_tests',
# ]

SECRET_KEY = "django_tests_secret_key"

# Use a fast hasher to speed up tests.
PASSWORD_HASHERS = [
"django.contrib.auth.hashers.MD5PasswordHasher",
]

DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

USE_TZ = False
```

results in:
```
Testing against Django installed in
'/home/florian/sources/django.git/django' with up to 16 processes
Importing application postgres_tests
Found 1 test(s).
Skipping setup of unused database(s): other.
Using existing test database for alias 'default' ('test_django')...
Operations to perform:
Synchronize unmigrated apps: auth, contenttypes, messages, sessions,
staticfiles
Apply all migrations: admin, postgres_tests, sites
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Running migrations:
No migrations to apply.
Your models in app(s): 'postgres_tests' have changes that are not yet
reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run
'manage.py migrate' to apply them.
System check identified no issues (0 silenced).
test_ranked_custom_weights
(postgres_tests.test_search.TestRankingAndWeights) ... ok
```

We should investigate why we miss migrations here.

--
Ticket URL: <https://code.djangoproject.com/ticket/33704>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 13, 2022, 2:48:28 AM5/13/22
to django-...@googlegroups.com
#33704: Missing migrations in tests
-----------------------------------+--------------------------------------

Reporter: Florian Apolloner | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: dev
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------------+--------------------------------------
Description changed by Florian Apolloner:

Old description:

New description:

SECRET_KEY = "django_tests_secret_key"

DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

USE_TZ = False
}}}

--

--
Ticket URL: <https://code.djangoproject.com/ticket/33704#comment:1>

Reply all
Reply to author
Forward
0 new messages