MCPcopy
hub / github.com/django/django / AutodetectorTests

Class AutodetectorTests

tests/migrations/test_autodetector.py:225–5636  ·  view source on GitHub ↗

Tests the migration autodetector.

Source from the content-addressed store, hash-verified

223
224
225class AutodetectorTests(BaseAutodetectorTests):
226 """
227 Tests the migration autodetector.
228 """
229
230 author_empty = ModelState(
231 "testapp", "Author", [("id", models.AutoField(primary_key=True))]
232 )
233 author_name = ModelState(
234 "testapp",
235 "Author",
236 [
237 ("id", models.AutoField(primary_key=True)),
238 ("name", models.CharField(max_length=200)),
239 ],
240 )
241 author_name_null = ModelState(
242 "testapp",
243 "Author",
244 [
245 ("id", models.AutoField(primary_key=True)),
246 ("name", models.CharField(max_length=200, null=True)),
247 ],
248 )
249 author_name_longer = ModelState(
250 "testapp",
251 "Author",
252 [
253 ("id", models.AutoField(primary_key=True)),
254 ("name", models.CharField(max_length=400)),
255 ],
256 )
257 author_name_renamed = ModelState(
258 "testapp",
259 "Author",
260 [
261 ("id", models.AutoField(primary_key=True)),
262 ("names", models.CharField(max_length=200)),
263 ],
264 )
265 author_name_default = ModelState(
266 "testapp",
267 "Author",
268 [
269 ("id", models.AutoField(primary_key=True)),
270 ("name", models.CharField(max_length=200, default="Ada Lovelace")),
271 ],
272 )
273 author_name_db_default = ModelState(
274 "testapp",
275 "Author",
276 [
277 ("id", models.AutoField(primary_key=True)),
278 ("name", models.CharField(max_length=200, db_default="Ada Lovelace")),
279 ],
280 )
281 author_name_check_constraint = ModelState(
282 "testapp",

Callers

nothing calls this directly

Calls 4

ModelStateClass · 0.90
FoodManagerClass · 0.85
as_managerMethod · 0.80

Tested by

no test coverage detected