Re: [Django] #33256: Some schema tests don't clean up their tables

2022-03-21 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  Mohammad
 Type:   |  Ali Mehdizadeh
  Cleanup/optimization   |   Status:  closed
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mariusz Felisiak ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"4b66a5e61780416d8d99e61193f93dc3351caf2c" 4b66a5e6]:
 {{{
 #!CommitTicketReference repository=""
 revision="4b66a5e61780416d8d99e61193f93dc3351caf2c"
 Fixed #33256 -- Fixed schema test failures when using --keepdb.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107017faffadc8d-fde499fb-863b-4139-b3a5-54ce9575dd2e-00%40eu-central-1.amazonses.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2022-03-21 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  Mohammad
 Type:   |  Ali Mehdizadeh
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * needs_better_patch:  1 => 0
 * stage:  Accepted => Ready for checkin


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107017fad997c29-a4e5f2cd-a6f7-45e1-b522-07081f352dc5-00%40eu-central-1.amazonses.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2022-03-21 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  Mohammad
 Type:   |  Ali Mehdizadeh
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * needs_better_patch:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107017fab47eca1-2b90fef0-9bf6-41f4-b8a8-b10ff6252a38-00%40eu-central-1.amazonses.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2022-03-18 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  Mohammad
 Type:   |  Ali Mehdizadeh
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mohammad Ali Mehdizadeh):

 * has_patch:  0 => 1


Comment:

 I create a PR [https://github.com/django/django/pull/15528]
 feel free to feedback me

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107017f9ef2426f-10cfaba4-6d88-4113-a3f5-34229349c44a-00%40eu-central-1.amazonses.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2022-03-18 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  Mohammad
 Type:   |  Ali Mehdizadeh
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Tim Graham):

 You only need to fix the existing errors. No additional tests are needed.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107017f9e26fab0-b943e2ea-bc57-4784-a037-4b03e124cf14-00%40eu-central-1.amazonses.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2022-03-18 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  Mohammad
 Type:   |  Ali Mehdizadeh
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Mohammad Ali Mehdizadeh):

 Replying to [comment:16 Tim Graham]:
 Do you have any idea, how to write a test for this scenario.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107017f9e161e6a-b6bdb4bf-e7c1-4714-84cb-908936cc23ca-00%40eu-central-1.amazonses.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2022-03-16 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  Mohammad
 Type:   |  Ali Mehdizadeh
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Tim Graham):

 I attached an initial patch to this ticket. You should apply similar
 techniques to other tests.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107017f94a2ace7-2ac9dbc3-42c7-4516-96f2-af2c567902f4-00%40eu-central-1.amazonses.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2022-03-16 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  Mohammad
 Type:   |  Ali Mehdizadeh
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Mohammad Ali Mehdizadeh):

 Replying to [comment:13 Tim Graham]:

 Thank you for guidance, I create the same error.
 So have you any idea how to solve this issue?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107017f9487c40e-8a889fa9-f06c-40e8-aed1-254c74549b88-00%40eu-central-1.amazonses.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2022-03-16 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  Mohammad
 Type:   |  Ali Mehdizadeh
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Mohammad Ali Mehdizadeh):

 Thank you for guidance, I create the same error.

 So have you any idea how to solve this issue?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107017f94215c39-e88cc7de-9321-499e-a122-31e744331ea6-00%40eu-central-1.amazonses.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2022-03-15 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  Mohammad
 Type:   |  Ali Mehdizadeh
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Tim Graham):

 The errors happen on a second consecutive test run (and don't remove the
 existing database between test runs).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107017f8ddf22ff-4e28c0ff-99f5-4bc6-a665-607a2116a8f4-00%40eu-central-1.amazonses.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2022-03-15 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  Mohammad
 Type:   |  Ali Mehdizadeh
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Mohammad Ali Mehdizadeh):

 This is my test_postgres.py file:


 {{{
 DATABASES = {
 'default': {
 'ENGINE': 'django.db.backends.postgresql',
 'USER': 'postgres_user',
 'PASSWORD': 'postgres_password',
 'HOST': 'postgres_host',
 'PORT': 'postgres_port',
 },
 'other': {
 'ENGINE': 'django.db.backends.postgresql',
 'USER': 'postgres_user',
 'PASSWORD': 'postgres_password',
 'HOST': 'postgres_host',
 'PORT': 'postgres_port',
 },
 }

 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
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107017f8ddcc5b4-b9bc3831-2c25-4bbe-bf25-ec2e7ded203f-00%40eu-central-1.amazonses.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2022-03-15 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  Mohammad
 Type:   |  Ali Mehdizadeh
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Mohammad Ali Mehdizadeh):

 Replying to [comment:9 Tim Graham]:
 > Have you run the command a second time so that you're reusing an
 existing database?

 No, I use a new instance of postgres and I check the databases and remove
 ''test_'' database each time.
 But I can't produce errors.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107017f8dd929ba-db3cdf5b-de2b-4b24-bb56-146d3366b13e-00%40eu-central-1.amazonses.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2022-03-14 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  Mohammad
 Type:   |  Ali Mehdizadeh
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mohammad Ali Mehdizadeh):

 * owner:  banani720 => Mohammad Ali Mehdizadeh


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107017f8778e0f6-e40043aa-56ac-42ff-95d4-1af8db91e355-00%40eu-central-1.amazonses.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2022-03-13 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  banani720
 Type:   |   Status:  assigned
  Cleanup/optimization   |
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Tim Graham):

 Have you run the command a second time so that you're reusing an existing
 database?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107017f8491cef6-841a72ad-b4bf-4daa-94aa-8d549345ed93-00%40eu-central-1.amazonses.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2022-03-13 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  banani720
 Type:   |   Status:  assigned
  Cleanup/optimization   |
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Mohammad Ali Mehdizadeh):

 Replying to [ticket:33256 Tim Graham]:
 > Some test errors on a second consecutive run of `./tests/runtests.py
 --settings=test_postgres  --parallel=1 --keepdb schema` shows that some
 tests leave behind their tables. Attached is an initial patch for a couple
 of the cases.
 > {{{
 > ==
 > ERROR: test_add_foreign_key_quoted_db_table (schema.tests.SchemaTests)
 > --
 > Traceback (most recent call last):
 >   File "/home/tim/code/django/django/db/backends/utils.py", line 82, in
 _execute
 > return self.cursor.execute(sql)
 > psycopg2.errors.DuplicateTable: relation "table_author_double_quoted"
 already exists
 >
 >
 > The above exception was the direct cause of the following exception:
 >
 > Traceback (most recent call last):
 >   File "/home/tim/code/django/django/test/utils.py", line 437, in inner
 > return func(*args, **kwargs)
 >   File "/home/tim/code/django/django/test/testcases.py", line 1305, in
 skip_wrapper
 > return test_func(*args, **kwargs)
 >   File "/home/tim/code/django/tests/schema/tests.py", line 3229, in
 test_add_foreign_key_quoted_db_table
 > editor.create_model(Author)
 >   File "/home/tim/code/django/django/db/backends/base/schema.py", line
 355, in create_model
 > self.execute(sql, params or None)
 >   File "/home/tim/code/django/django/db/backends/base/schema.py", line
 151, in execute
 > cursor.execute(sql, params)
 >   File "/home/tim/code/django/django/db/backends/utils.py", line 66, in
 execute
 > return self._execute_with_wrappers(sql, params, many=False,
 executor=self._execute)
 >   File "/home/tim/code/django/django/db/backends/utils.py", line 75, in
 _execute_with_wrappers
 > return executor(sql, params, many, context)
 >   File "/home/tim/code/django/django/db/backends/utils.py", line 84, in
 _execute
 > return self.cursor.execute(sql, params)
 >   File "/home/tim/code/django/django/db/utils.py", line 90, in __exit__
 > raise dj_exc_value.with_traceback(traceback) from exc_value
 >   File "/home/tim/code/django/django/db/backends/utils.py", line 82, in
 _execute
 > return self.cursor.execute(sql)
 > django.db.utils.ProgrammingError: relation "table_author_double_quoted"
 already exists
 >
 >
 > ==
 > ERROR: test_add_foreign_object (schema.tests.SchemaTests)
 > --
 > Traceback (most recent call last):
 >   File "/home/tim/code/django/django/db/backends/utils.py", line 82, in
 _execute
 > return self.cursor.execute(sql)
 > psycopg2.errors.DuplicateTable: relation "schema_bookforeignobj" already
 exists
 >
 >
 > The above exception was the direct cause of the following exception:
 >
 > Traceback (most recent call last):
 >   File "/home/tim/code/django/tests/schema/tests.py", line 3238, in
 test_add_foreign_object
 > editor.create_model(BookForeignObj)
 >   File "/home/tim/code/django/django/db/backends/base/schema.py", line
 355, in create_model
 > self.execute(sql, params or None)
 >   File "/home/tim/code/django/django/db/backends/base/schema.py", line
 151, in execute
 > cursor.execute(sql, params)
 >   File "/home/tim/code/django/django/db/backends/utils.py", line 66, in
 execute
 > return self._execute_with_wrappers(sql, params, many=False,
 executor=self._execute)
 >   File "/home/tim/code/django/django/db/backends/utils.py", line 75, in
 _execute_with_wrappers
 > return executor(sql, params, many, context)
 >   File "/home/tim/code/django/django/db/backends/utils.py", line 84, in
 _execute
 > return self.cursor.execute(sql, params)
 >   File "/home/tim/code/django/django/db/utils.py", line 90, in __exit__
 > raise dj_exc_value.with_traceback(traceback) from exc_value
 >   File "/home/tim/code/django/django/db/backends/utils.py", line 82, in
 _execute
 > return self.cursor.execute(sql)
 > django.db.utils.ProgrammingError: relation 

Re: [Django] #33256: Some schema tests don't clean up their tables

2022-03-09 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  banani720
 Type:   |   Status:  assigned
  Cleanup/optimization   |
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Mohammad Ali Mehdizadeh):

 Can I work on this ticket please?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107017f6f7b6fdb-15cc7ae8-fd80-482c-ba47-5203e5a81fb1-00%40eu-central-1.amazonses.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2021-12-29 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  banani720
 Type:   |   Status:  assigned
  Cleanup/optimization   |
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 Replying to [comment:5 Ayush Joshi]:
 > When I run this command I don't know why but I'm getting the following
 {{{ModuleNotFoundError}}}, could you please help?

 `--settings` should be a path to your `settings` (see
 [https://docs.djangoproject.com/en/4.0/internals/contributing/writing-code
 /unit-tests/#using-another-settings-module docs]) not a test module. If
 you're having trouble understanding how Django works, see
 TicketClosingReasons/UseSupportChannels for ways to get help.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.8b93d6106bced012c21cf1e2b0b112c9%40djangoproject.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2021-12-29 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  banani720
 Type:   |   Status:  assigned
  Cleanup/optimization   |
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Ayush Joshi):

 Replying to [comment:4 Mariusz Felisiak]:
 > > If I have not done all of the cases yet, but just want to check in to
 see if I am going about this the correct way, should I still submit a pr?
 >
 > I don't think there is a need to submit PR at this stage. You should be
 able to [https://docs.djangoproject.com/en/3.2/internals/contributing
 /writing-code/unit-tests/ run tests locally] and check that all `schema`
 tests work:
 > {{{
 > ./runtests.py --settings=test_postgres --parallel=1 --keepdb schema
 > }}}
 > I'd submit PR when all test pass.

 When I run this command I don't know why but I'm getting the following
 {{{ModuleNotFoundError}}}, could you please help?

 {{{
 Testing against Django installed in '/Python/django/django'
 Traceback (most recent call last):
   File "./runtests.py", line 657, in 
 failures = django_tests(
   File "./runtests.py", line 348, in django_tests
 test_labels, state = setup_run_tests(verbosity, start_at, start_after,
 test_labels)
   File "./runtests.py", line 278, in setup_run_tests
 test_modules, state = setup_collect_tests(start_at, start_after,
 test_labels=test_labels)
   File "./runtests.py", line 193, in setup_collect_tests
 'INSTALLED_APPS': settings.INSTALLED_APPS,
   File "/Python/django/django/conf/__init__.py", line 89, in __getattr__
 self._setup(name)
   File "/Python/django/django/conf/__init__.py", line 76, in _setup
 self._wrapped = Settings(settings_module)
   File "/Python/django/django/conf/__init__.py", line 184, in __init__
 mod = importlib.import_module(self.SETTINGS_MODULE)
   File "/usr/lib/python3.8/importlib/__init__.py", line 127, in
 import_module
 return _bootstrap._gcd_import(name[level:], package, level)
   File "", line 1014, in _gcd_import
   File "", line 991, in _find_and_load
   File "", line 973, in
 _find_and_load_unlocked
 ModuleNotFoundError: No module named 'test_postgres'
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.20dddcba0f614a5e522931b5d889cdb3%40djangoproject.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2021-11-04 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  banani720
 Type:   |   Status:  assigned
  Cleanup/optimization   |
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 > If I have not done all of the cases yet, but just want to check in to
 see if I am going about this the correct way, should I still submit a pr?

 I don't think there is a need to submit PR at this stage. You should be
 able to [https://docs.djangoproject.com/en/3.2/internals/contributing
 /writing-code/unit-tests/ run tests locally] and check that all `schema`
 tests work:
 {{{
 ./runtests.py --settings=test_postgres --parallel=1 --keepdb schema
 }}}
 I'd submit PR when all test pass.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.73a4d1370eafc92656956658d7054690%40djangoproject.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2021-11-04 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  banani720
 Type:   |   Status:  assigned
  Cleanup/optimization   |
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by banani720):

 If I have not done all of the cases yet, but just want to check in to see
 if I am going about this the correct way, should I still submit a pr? I've
 added a `try-finally` clauses to a couple of the test cases that are
 mentioned in the error log. This is my first time contributing to an open-
 source and the tutorial isn't quite clear how I should handle a situation
 like this. Any guidance would be appreciated.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.6638fa24401680ea996c7ff8083fc987%40djangoproject.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2021-11-04 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  banani720
 Type:   |   Status:  assigned
  Cleanup/optimization   |
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by banani720):

 * owner:  nobody => banani720
 * status:  new => assigned


Comment:

 []

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.0babbc2ff740c0ea911aafb6bdf251d3%40djangoproject.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2021-11-03 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * stage:  Unreviewed => Accepted


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.1004ddeee722e9fc46d4ea6ebb081aec%40djangoproject.com.


Re: [Django] #33256: Some schema tests don't clean up their tables

2021-11-02 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
 Reporter:  Tim Graham   |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 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
-+-
Changes (by Tim Graham):

 * Attachment "33256-init.diff" added.


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.047188f02e2eb12fd077202e52b0%40djangoproject.com.


[Django] #33256: Some schema tests don't clean up their tables

2021-11-02 Thread Django
#33256: Some schema tests don't clean up their tables
-+-
   Reporter:  Tim|  Owner:  nobody
  Graham |
   Type: | Status:  new
  Cleanup/optimization   |
  Component:  Database   |Version:  dev
  layer (models, ORM)|
   Severity:  Normal |   Keywords:
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  1
  UI/UX:  0  |
-+-
 Some test errors on a second consecutive run of `./tests/runtests.py
 --settings=test_postgres  --parallel=1 --keepdb schema` shows that some
 tests leave behind their tables. Attached is an initial patch for a couple
 of the cases.
 {{{
 ==
 ERROR: test_add_foreign_key_quoted_db_table (schema.tests.SchemaTests)
 --
 Traceback (most recent call last):
   File "/home/tim/code/django/django/db/backends/utils.py", line 82, in
 _execute
 return self.cursor.execute(sql)
 psycopg2.errors.DuplicateTable: relation "table_author_double_quoted"
 already exists


 The above exception was the direct cause of the following exception:

 Traceback (most recent call last):
   File "/home/tim/code/django/django/test/utils.py", line 437, in inner
 return func(*args, **kwargs)
   File "/home/tim/code/django/django/test/testcases.py", line 1305, in
 skip_wrapper
 return test_func(*args, **kwargs)
   File "/home/tim/code/django/tests/schema/tests.py", line 3229, in
 test_add_foreign_key_quoted_db_table
 editor.create_model(Author)
   File "/home/tim/code/django/django/db/backends/base/schema.py", line
 355, in create_model
 self.execute(sql, params or None)
   File "/home/tim/code/django/django/db/backends/base/schema.py", line
 151, in execute
 cursor.execute(sql, params)
   File "/home/tim/code/django/django/db/backends/utils.py", line 66, in
 execute
 return self._execute_with_wrappers(sql, params, many=False,
 executor=self._execute)
   File "/home/tim/code/django/django/db/backends/utils.py", line 75, in
 _execute_with_wrappers
 return executor(sql, params, many, context)
   File "/home/tim/code/django/django/db/backends/utils.py", line 84, in
 _execute
 return self.cursor.execute(sql, params)
   File "/home/tim/code/django/django/db/utils.py", line 90, in __exit__
 raise dj_exc_value.with_traceback(traceback) from exc_value
   File "/home/tim/code/django/django/db/backends/utils.py", line 82, in
 _execute
 return self.cursor.execute(sql)
 django.db.utils.ProgrammingError: relation "table_author_double_quoted"
 already exists


 ==
 ERROR: test_add_foreign_object (schema.tests.SchemaTests)
 --
 Traceback (most recent call last):
   File "/home/tim/code/django/django/db/backends/utils.py", line 82, in
 _execute
 return self.cursor.execute(sql)
 psycopg2.errors.DuplicateTable: relation "schema_bookforeignobj" already
 exists


 The above exception was the direct cause of the following exception:

 Traceback (most recent call last):
   File "/home/tim/code/django/tests/schema/tests.py", line 3238, in
 test_add_foreign_object
 editor.create_model(BookForeignObj)
   File "/home/tim/code/django/django/db/backends/base/schema.py", line
 355, in create_model
 self.execute(sql, params or None)
   File "/home/tim/code/django/django/db/backends/base/schema.py", line
 151, in execute
 cursor.execute(sql, params)
   File "/home/tim/code/django/django/db/backends/utils.py", line 66, in
 execute
 return self._execute_with_wrappers(sql, params, many=False,
 executor=self._execute)
   File "/home/tim/code/django/django/db/backends/utils.py", line 75, in
 _execute_with_wrappers
 return executor(sql, params, many, context)
   File "/home/tim/code/django/django/db/backends/utils.py", line 84, in
 _execute
 return self.cursor.execute(sql, params)
   File "/home/tim/code/django/django/db/utils.py", line 90, in __exit__
 raise dj_exc_value.with_traceback(traceback) from exc_value
   File "/home/tim/code/django/django/db/backends/utils.py", line 82, in
 _execute
 return self.cursor.execute(sql)
 django.db.utils.ProgrammingError: relation "schema_bookforeignobj" already
 exists


 ==
 ERROR: test_remove_db_index_doesnt_remove_custom_indexes
 (schema.tests.SchemaTests)
 Changing db_index to False doesn't remove indexes from