repo stringclasses 1
value | instance_id stringlengths 20 20 | base_commit stringlengths 40 40 | patch stringlengths 386 5.2k | test_patch stringlengths 478 4.45k | problem_statement stringlengths 190 8.54k | hints_text stringlengths 0 9.06k | created_at stringdate 2021-05-04 20:10:27 2022-04-08 06:55:17 | version stringclasses 2
values | FAIL_TO_PASS stringlengths 52 15.4k | PASS_TO_PASS stringlengths 2 28.5k | environment_setup_commit stringclasses 2
values | difficulty stringclasses 3
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
django/django | django__django-14349 | a708f39ce67af174df90c5b5e50ad1976cec7cb8 | diff --git a/django/core/validators.py b/django/core/validators.py
--- a/django/core/validators.py
+++ b/django/core/validators.py
@@ -92,6 +92,7 @@ class URLValidator(RegexValidator):
r'\Z', re.IGNORECASE)
message = _('Enter a valid URL.')
schemes = ['http', 'https', 'ftp', 'ftps']
+ unsafe_chars... | diff --git a/tests/validators/tests.py b/tests/validators/tests.py
--- a/tests/validators/tests.py
+++ b/tests/validators/tests.py
@@ -226,9 +226,15 @@
(URLValidator(), None, ValidationError),
(URLValidator(), 56, ValidationError),
(URLValidator(), 'no_scheme', ValidationError),
- # Trailing newlines ... | URLValidator tests failing on Python versions patched for bpo-43882
Description
On Python versions with a fix for bpo-43882 (i.e. 3.10.0b1 and the 3.9 git branch, not released yet) the following tests fail:
======================================================================
FAIL: test_validators (validators.tests... | Thanks for the report. We noticed this issue.
Duplicate of #32074.
For the record, I was wrong that this hasn't been released in 3.9 -- it's part of 3.9.5.
It looks that it will be backported to all supported versions of Python. | 2021-05-04T20:10:27Z | 4.0 | ["test_validators (validators.tests.TestValidators)"] | ["test_domain_whitelist (validators.tests.DeprecationTests)", "test_domain_whitelist_access_warning (validators.tests.DeprecationTests)", "test_domain_whitelist_set_warning (validators.tests.DeprecationTests)", "test_whitelist (validators.tests.DeprecationTests)", "test_whitelist_warning (validators.tests.DeprecationTe... | 475cffd1d64c690cdad16ede4d5e81985738ceb4 | 15 min - 1 hour |
django/django | django__django-14351 | 06fd4df41afb5aa1d681b853c3c08d8c688ca3a5 | diff --git a/django/db/models/lookups.py b/django/db/models/lookups.py
--- a/django/db/models/lookups.py
+++ b/django/db/models/lookups.py
@@ -406,6 +406,15 @@ def process_rhs(self, compiler, connection):
self.rhs.add_fields(['pk'])
return super().process_rhs(compiler, connection)
+ d... | diff --git a/tests/aggregation_regress/tests.py b/tests/aggregation_regress/tests.py
--- a/tests/aggregation_regress/tests.py
+++ b/tests/aggregation_regress/tests.py
@@ -1525,6 +1525,14 @@ class DistinctAggregate(Aggregate):
allow_distinct = True
DistinctAggregate('foo', distinct=True)
+ @sk... | Q object __or__ appears to get all dunder related's default columns and queryset raises ProgrammingError.
Description
There appears to be a difference in how Q object aliases are setup, when OR'd. The get_default_columns for this agent__property_groups__id__in only uses 1, where as get_default_columns for this agent_... | Thanks for the report. Can you provide a sample project? (models definition and a complete queryset). I cannot reproduce this issue with provided details.
Replying to Mariusz Felisiak: Thanks for the report. Can you provide a sample project? (models definition and a complete queryset). I cannot reproduce this issue wit... | 2021-05-05T03:50:44Z | 4.0 | ["test_having_subquery_select (aggregation_regress.tests.AggregationTests)"] | ["test_ticket_24748 (aggregation_regress.tests.SelfReferentialFKTests)", "test_existing_join_not_promoted (aggregation_regress.tests.JoinPromotionTests)", "test_non_nullable_fk_not_promoted (aggregation_regress.tests.JoinPromotionTests)", "test_ticket_21150 (aggregation_regress.tests.JoinPromotionTests)", "test_aggrega... | 475cffd1d64c690cdad16ede4d5e81985738ceb4 | 15 min - 1 hour |
django/django | django__django-14373 | b1a4b1f0bdf05adbd3dc4dde14228e68da54c1a3 | diff --git a/django/utils/dateformat.py b/django/utils/dateformat.py
--- a/django/utils/dateformat.py
+++ b/django/utils/dateformat.py
@@ -313,8 +313,8 @@ def y(self):
return '%02d' % (self.data.year % 100)
def Y(self):
- "Year, 4 digits; e.g. '1999'"
- return self.data.year
+ """Ye... | diff --git a/tests/utils_tests/test_dateformat.py b/tests/utils_tests/test_dateformat.py
--- a/tests/utils_tests/test_dateformat.py
+++ b/tests/utils_tests/test_dateformat.py
@@ -166,7 +166,7 @@ def test_r_format_with_non_en_locale(self):
'Sun, 08 Jul 1979 22:00:00 +0100',
)
- def tes... | DateFormat.Y() is not zero-padded.
Description
The Y specifier for django.utils.dateformat.DateFormat is supposed to always return a four-digit year padded with zeros. This doesn't seem to be the case for year < 1000.
| 2021-05-10T14:40:32Z | 4.0 | ["test_Y_format_year_before_1000 (utils_tests.test_dateformat.DateFormatTests)"] | ["test_am_pm (utils_tests.test_dateformat.DateFormatTests)", "test_date (utils_tests.test_dateformat.DateFormatTests)", "test_date_formats (utils_tests.test_dateformat.DateFormatTests)", "test_dateformat (utils_tests.test_dateformat.DateFormatTests)", "test_datetime_with_local_tzinfo (utils_tests.test_dateformat.DateFo... | 475cffd1d64c690cdad16ede4d5e81985738ceb4 | <15 min fix | |
django/django | django__django-14376 | d06c5b358149c02a62da8a5469264d05f29ac659 | diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py
--- a/django/db/backends/mysql/base.py
+++ b/django/db/backends/mysql/base.py
@@ -200,9 +200,9 @@ def get_connection_params(self):
if settings_dict['USER']:
kwargs['user'] = settings_dict['USER']
if settings_... | diff --git a/tests/dbshell/test_mysql.py b/tests/dbshell/test_mysql.py
--- a/tests/dbshell/test_mysql.py
+++ b/tests/dbshell/test_mysql.py
@@ -50,41 +50,49 @@ def test_options_override_settings_proper_values(self):
'optiondbname',
]
expected_env = {'MYSQL_PWD': 'optionpassword'}
- ... | MySQL backend uses deprecated "db" and "passwd" kwargs.
Description
The "db" and "passwd" usage can be seen at https://github.com/django/django/blob/ca9872905559026af82000e46cde6f7dedc897b6/django/db/backends/mysql/base.py#L202-L205 in main. mysqlclient recently marked these two kwargs as deprecated (see https://gi... | Thanks for this report. Django 2.2, 3.1, and 3.2 all require a minimum version of mysqlclient newer than 1.3.8, so a fix for this could be backported to all currently supported versions of Django. Django 2.2 and 3.1 are in extended support so they don't receive bugfixes anymore (except security patches). We'll document... | 2021-05-10T20:42:18Z | 4.0 | ["test_options_non_deprecated_keys_preferred (dbshell.test_mysql.MySqlDbshellCommandTestCase)", "test_options_override_settings_proper_values (dbshell.test_mysql.MySqlDbshellCommandTestCase)", "test_parameters (dbshell.test_mysql.MySqlDbshellCommandTestCase)"] | ["test_basic_params_specified_in_settings (dbshell.test_mysql.MySqlDbshellCommandTestCase)", "test_can_connect_using_sockets (dbshell.test_mysql.MySqlDbshellCommandTestCase)", "test_crash_password_does_not_leak (dbshell.test_mysql.MySqlDbshellCommandTestCase)", "test_fails_with_keyerror_on_incomplete_config (dbshell.te... | 475cffd1d64c690cdad16ede4d5e81985738ceb4 | <15 min fix |
django/django | django__django-14404 | de32fe83a2e4a20887972c69a0693b94eb25a88b | diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
--- a/django/contrib/admin/sites.py
+++ b/django/contrib/admin/sites.py
@@ -420,14 +420,13 @@ def autocomplete_view(self, request):
def catch_all_view(self, request, url):
if settings.APPEND_SLASH and not url.endswith('/'):
... | diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -6602,6 +6602,42 @@ def test_missing_slash_append_slash_true(self):
response = self.client.get(known_url[:-1])
self.assertRedirects(response, known_url, status_code... | catch_all_view() does not support FORCE_SCRIPT_NAME.
Description
(last modified by SlavaSkvortsov)
catch_all_view returns redirect to '%s/' % request.path_info (script name cut off there) instead of '%s/' % request.path (with the script name)
Patch - https://github.com/django/django/pull/14404
| 2021-05-17T11:24:06Z | 4.0 | ["test_missing_slash_append_slash_true_force_script_name (admin_views.tests.AdminSiteFinalCatchAllPatternTests)", "test_missing_slash_append_slash_true_script_name (admin_views.tests.AdminSiteFinalCatchAllPatternTests)"] | ["test_explicitly_provided_pk (admin_views.tests.GetFormsetsWithInlinesArgumentTest)", "test_implicitly_generated_pk (admin_views.tests.GetFormsetsWithInlinesArgumentTest)", "test_should_be_able_to_edit_related_objects_on_add_view (admin_views.tests.AdminCustomSaveRelatedTests)", "test_should_be_able_to_edit_related_ob... | 475cffd1d64c690cdad16ede4d5e81985738ceb4 | <15 min fix | |
django/django | django__django-14434 | 5e04e84d67da8163f365e9f5fcd169e2630e2873 | diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py
--- a/django/db/backends/base/schema.py
+++ b/django/db/backends/base/schema.py
@@ -1241,9 +1241,9 @@ def create_unique_name(*args, **kwargs):
return self.quote_name(self._create_index_name(*args, **kwargs))
compi... | diff --git a/tests/schema/tests.py b/tests/schema/tests.py
--- a/tests/schema/tests.py
+++ b/tests/schema/tests.py
@@ -2198,6 +2198,22 @@ def test_remove_unique_together_does_not_remove_meta_constraints(self):
AuthorWithUniqueNameAndBirthday._meta.constraints = []
editor.remove_constraint(Auth... | Statement created by _create_unique_sql makes references_column always false
Description
This is due to an instance of Table is passed as an argument to Columns when a string is expected.
| 2021-05-23T12:27:14Z | 4.0 | ["test_unique_constraint (schema.tests.SchemaTests)"] | ["effective_default() should be used for DateField, DateTimeField, and", "Tests adding fields to models", "Tests binary fields get a sane default (#22851)", "test_add_field_db_collation (schema.tests.SchemaTests)", "test_add_field_default_dropped (schema.tests.SchemaTests)", "test_add_field_default_nullable (schema.tes... | 475cffd1d64c690cdad16ede4d5e81985738ceb4 | 15 min - 1 hour | |
django/django | django__django-14493 | 7272e1963ffdf39c1d4fe225d5425a45dd095d11 | diff --git a/django/contrib/staticfiles/storage.py b/django/contrib/staticfiles/storage.py
--- a/django/contrib/staticfiles/storage.py
+++ b/django/contrib/staticfiles/storage.py
@@ -260,6 +260,7 @@ def post_process(self, paths, dry_run=False, **options):
processed_adjustable_paths[name] = (name, hashe... | diff --git a/tests/staticfiles_tests/storage.py b/tests/staticfiles_tests/storage.py
--- a/tests/staticfiles_tests/storage.py
+++ b/tests/staticfiles_tests/storage.py
@@ -97,3 +97,7 @@ class ExtraPatternsStorage(ManifestStaticFilesStorage):
class NoneHashStorage(ManifestStaticFilesStorage):
def file_hash(self, na... | ManifestStaticFilesStorage crashes with max_post_process_passes = 0.
Description
To reproduce:
Derive a custom class from ManifestStaticFilesStorage and set max_post_process_passes to 0:
class MyManifestStaticFilesStorage(ManifestStaticFilesStorage):
max_post_process_passes = 0
# settings.py
STATICFILES_STORAGE = "M... | An effective workaround is overriding patterns = (). It might not be worth fixing the UnboundLocalError.
I think it's worth fixing.
Hi guys, Can I work on this?
Replying to kingliar420: Can I work on this? Sure there is no need to ask. Please remember that a regression test is required. | 2021-06-05T12:50:25Z | 4.0 | ["test_collectstatistic_no_post_process_replaced_paths (staticfiles_tests.test_storage.TestCollectionNoPostProcessReplacedPaths)"] | ["test_hashed_name (staticfiles_tests.test_storage.TestCollectionNoneHashStorage)", "With storage classes having several file extension patterns, only the", "test_collect_static_files_default_permissions (staticfiles_tests.test_storage.TestStaticFilePermissions)", "test_collect_static_files_permissions (staticfiles_tes... | 475cffd1d64c690cdad16ede4d5e81985738ceb4 | <15 min fix |
django/django | django__django-14500 | 8c3bd0b708b488a1f6e8bd8cc6b96569904605be | diff --git a/django/db/migrations/executor.py b/django/db/migrations/executor.py
--- a/django/db/migrations/executor.py
+++ b/django/db/migrations/executor.py
@@ -250,12 +250,11 @@ def unapply_migration(self, state, migration, fake=False):
if not fake:
with self.connection.schema_editor(atomic=mig... | diff --git a/tests/migrations/test_executor.py b/tests/migrations/test_executor.py
--- a/tests/migrations/test_executor.py
+++ b/tests/migrations/test_executor.py
@@ -653,6 +653,23 @@ def test_migrate_marks_replacement_applied_even_if_it_did_nothing(self):
recorder.applied_migrations(),
)
+ @... | Squashed migration is not marked as unapplied
Description
(last modified by Markus Holtermann)
When unapplying a squashed migration and the replaced migration files are still around, the MigrationExecutor mark the squash migration as unapplied, too, not only the replaced migrations.
| While working on #24800 I realized that the issue is actually not fully correct. The squashed migration is not marked as applied.
PR: https://github.com/django/django/pull/5280
The commit this depends on is moved to "Work in progress" status, so moving this off the checkin queue.
Updated ticket, since original PR was ... | 2021-06-08T05:08:08Z | 4.0 | ["test_migrate_marks_replacement_unapplied (migrations.test_executor.ExecutorTests)"] | ["If the current state satisfies the given target, do nothing.", "Minimize unnecessary rollbacks in connected apps.", "Minimize rollbacks when target has multiple in-app children.", "test_alter_id_type_with_fk (migrations.test_executor.ExecutorTests)", "Applying all replaced migrations marks replacement as applied (#24... | 475cffd1d64c690cdad16ede4d5e81985738ceb4 | 15 min - 1 hour |
django/django | django__django-14534 | 910ecd1b8df7678f45c3d507dde6bcb1faafa243 | diff --git a/django/forms/boundfield.py b/django/forms/boundfield.py
--- a/django/forms/boundfield.py
+++ b/django/forms/boundfield.py
@@ -277,7 +277,7 @@ def template_name(self):
@property
def id_for_label(self):
- return 'id_%s_%s' % (self.data['name'], self.data['index'])
+ return self.data... | diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py
--- a/tests/forms_tests/tests/test_forms.py
+++ b/tests/forms_tests/tests/test_forms.py
@@ -720,7 +720,7 @@ class BeatleForm(Form):
fields = list(BeatleForm(auto_id=False)['name'])
self.assertEqual(len(fields), ... | BoundWidget.id_for_label ignores id set by ChoiceWidget.options
Description
If you look at the implementation of BoundField.subwidgets
class BoundField:
...
def subwidgets(self):
id_ = self.field.widget.attrs.get('id') or self.auto_id
attrs = {'id': id_} if id_ else {}
attrs = self.build_widget_attrs(attrs)
... | Hey Jacob — Sounds right: I didn't look in-depth but, if you can put your example in a test case it will be clear enough in the PR. Thanks.
Thanks Carlton, I will create a pull request asap.
Here is a pull request fixing this bug: https://github.com/django/django/pull/14533 (closed without merging)
Here is the new pul... | 2021-06-17T15:37:34Z | 4.0 | ["If auto_id is provided when initializing the form, the generated ID in", "test_iterable_boundfield_select (forms_tests.tests.test_forms.FormsTestCase)"] | ["test_attribute_class (forms_tests.tests.test_forms.RendererTests)", "test_attribute_instance (forms_tests.tests.test_forms.RendererTests)", "test_attribute_override (forms_tests.tests.test_forms.RendererTests)", "test_default (forms_tests.tests.test_forms.RendererTests)", "test_kwarg_class (forms_tests.tests.test_for... | 475cffd1d64c690cdad16ede4d5e81985738ceb4 | <15 min fix |
django/django | django__django-14539 | 6a5ef557f80a8eb6a758ebe99c8bb477ca47459e | diff --git a/django/utils/html.py b/django/utils/html.py
--- a/django/utils/html.py
+++ b/django/utils/html.py
@@ -283,8 +283,9 @@ def trim_punctuation(lead, middle, trail):
middle_unescaped = html.unescape(middle)
stripped = middle_unescaped.rstrip(TRAILING_PUNCTUATION_CHARS)
if ... | diff --git a/tests/utils_tests/test_html.py b/tests/utils_tests/test_html.py
--- a/tests/utils_tests/test_html.py
+++ b/tests/utils_tests/test_html.py
@@ -250,6 +250,10 @@ def test_urlize(self):
'Search for google.com/?q=! and see.',
'Search for <a href="http://google.com/?q=">google.c... | urlize() does not handle html escaped string and trailing punctuation correctly
Description
Example:
urlize('Search for google.com/?q=1<! and see.')
# expected output
'Search for <a href="http://google.com/?q=1%3C">google.com/?q=1<</a>! and see.'
# actual output
'Search for <a href="http://google.com/?q=1%3C">goo... | https://github.com/django/django/pull/14539/
OK, thanks, the example looks right. It's always delicate but let's take this for review. Related to #26193. | 2021-06-19T11:31:16Z | 4.0 | ["test_urlize (utils_tests.test_html.TestUtilsHtml)", "test_urlize_unchanged_inputs (utils_tests.test_html.TestUtilsHtml)"] | ["test_conditional_escape (utils_tests.test_html.TestUtilsHtml)", "test_escape (utils_tests.test_html.TestUtilsHtml)", "test_escapejs (utils_tests.test_html.TestUtilsHtml)", "test_format_html (utils_tests.test_html.TestUtilsHtml)", "test_html_safe (utils_tests.test_html.TestUtilsHtml)", "test_html_safe_defines_html_err... | 475cffd1d64c690cdad16ede4d5e81985738ceb4 | <15 min fix |
django/django | django__django-14559 | d79be3ed39b76d3e34431873eec16f6dd354ab17 | diff --git a/django/db/models/query.py b/django/db/models/query.py
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -541,7 +541,7 @@ def bulk_update(self, objs, fields, batch_size=None):
if any(f.primary_key for f in fields):
raise ValueError('bulk_update() cannot be used with pr... | diff --git a/tests/queries/test_bulk_update.py b/tests/queries/test_bulk_update.py
--- a/tests/queries/test_bulk_update.py
+++ b/tests/queries/test_bulk_update.py
@@ -125,7 +125,8 @@ def test_update_custom_primary_key(self):
def test_empty_objects(self):
with self.assertNumQueries(0):
- Note.... | Include number of rows matched in bulk_update() return value
Description
Currently, bulk_update() returns None, unlike update(), which returns the number of rows matched.
It looks like it would be easy to add the same functionality to bulk_update() since bulk_update() simply calls update() repeatedly:
https://githu... | Also, if this feature is okayed, maybe the number could be returned in a way that would permit other useful numbers to be added to the return value in a backwards-compatible way later on. For example, the number could be returned as a property of a named tuple with one property. That way, if a new value is requested in... | 2021-06-26T05:38:46Z | 4.0 | ["test_empty_objects (queries.test_bulk_update.BulkUpdateTests)", "test_large_batch (queries.test_bulk_update.BulkUpdateTests)", "test_updated_rows_when_passing_duplicates (queries.test_bulk_update.BulkUpdateTests)"] | ["test_batch_size (queries.test_bulk_update.BulkUpdateNoteTests)", "test_foreign_keys_do_not_lookup (queries.test_bulk_update.BulkUpdateNoteTests)", "test_functions (queries.test_bulk_update.BulkUpdateNoteTests)", "test_multiple_fields (queries.test_bulk_update.BulkUpdateNoteTests)", "test_set_field_to_null (queries.te... | 475cffd1d64c690cdad16ede4d5e81985738ceb4 | 15 min - 1 hour |
django/django | django__django-14580 | 36fa071d6ebd18a61c4d7f1b5c9d17106134bd44 | diff --git a/django/db/migrations/serializer.py b/django/db/migrations/serializer.py
--- a/django/db/migrations/serializer.py
+++ b/django/db/migrations/serializer.py
@@ -273,7 +273,7 @@ def _format(self):
class TypeSerializer(BaseSerializer):
def serialize(self):
special_cases = [
- (models.M... | diff --git a/tests/migrations/test_writer.py b/tests/migrations/test_writer.py
--- a/tests/migrations/test_writer.py
+++ b/tests/migrations/test_writer.py
@@ -658,6 +658,13 @@ def test_serialize_functools_partialmethod(self):
def test_serialize_type_none(self):
self.assertSerializedEqual(type(None))
+ ... | Missing import statement in generated migration (NameError: name 'models' is not defined)
Description
I found a bug in Django's latest release: 3.2.4.
Given the following contents of models.py:
from django.db import models
class MyField(models.TextField):
pass
class MyBaseModel(models.Model):
class Meta:
abstrac... | I could reproduce the issue with 3.2.4, 2.2.24 and the main branch. For what it's worth, the issue doesn't occur if the class MyModel does inherit from MyMixin.
MyBaseModel is not necessary to reproduce this issue, it's due to the fact that MyModel doesn't have fields from django.db.models and has custom bases. It look... | 2021-07-01T07:38:03Z | 4.0 | ["test_serialize_type_model (migrations.test_writer.WriterTests)"] | ["test_args_kwargs_signature (migrations.test_writer.OperationWriterTests)", "test_args_signature (migrations.test_writer.OperationWriterTests)", "test_empty_signature (migrations.test_writer.OperationWriterTests)", "test_expand_args_signature (migrations.test_writer.OperationWriterTests)", "test_kwargs_signature (migr... | 475cffd1d64c690cdad16ede4d5e81985738ceb4 | <15 min fix |
django/django | django__django-14608 | 7f33c1e22dbc34a7afae7967783725b10f1f13b1 | diff --git a/django/forms/formsets.py b/django/forms/formsets.py
--- a/django/forms/formsets.py
+++ b/django/forms/formsets.py
@@ -333,7 +333,7 @@ def full_clean(self):
self._non_form_errors.
"""
self._errors = []
- self._non_form_errors = self.error_class()
+ self._non_form_err... | diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -3348,7 +3348,10 @@ def test_non_form_errors_is_errorlist(self):
response = self.client.post(reverse('admin:admin_views_person_changelist'), data)
non_form_errors =... | Add `nonform` CSS class for non form errors in FormSets
Description
(last modified by Ties Jan Hefting)
Forms add the nonfield CSS class for non field errors in ErrorList instances. This is documented in a section on rendering form error messages. Similarly, in FormSets I'd expect to see the nonform CSS class ... | Seems reasonable (similar to #11776).
PR | 2021-07-07T19:51:30Z | 4.0 | ["If validate_max is set and max_num is less than TOTAL_FORMS in the", "If validate_min is set and min_num is more than TOTAL_FORMS in the", "test_non_form_errors (forms_tests.tests.test_formsets.FormsFormsetTestCase)", "test_non_form_errors_is_errorlist (admin_views.tests.AdminViewListEditable)"] | ["all_valid() validates all forms, even when some are invalid.", "test_valid (forms_tests.tests.test_formsets.AllValidTests)", "is_multipart() works with an empty formset.", "An empty formset still calls clean()", "Media is available on empty formset.", "test_customize_management_form_error (forms_tests.tests.test_form... | 475cffd1d64c690cdad16ede4d5e81985738ceb4 | <15 min fix |
django/django | django__django-14631 | 84400d2e9db7c51fee4e9bb04c028f665b8e7624 | diff --git a/django/forms/boundfield.py b/django/forms/boundfield.py
--- a/django/forms/boundfield.py
+++ b/django/forms/boundfield.py
@@ -1,6 +1,7 @@
import datetime
import re
+from django.core.exceptions import ValidationError
from django.forms.utils import flatatt, pretty_name
from django.forms.widgets import ... | diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py
--- a/tests/forms_tests/tests/test_forms.py
+++ b/tests/forms_tests/tests/test_forms.py
@@ -2112,15 +2112,47 @@ class DateTimeForm(Form):
self.assertEqual(unbound['hi_without_microsec'].value(), now_no_ms)
self.... | BaseForm's _clean_fields() and changed_data should access values via BoundField
Description
(last modified by Chris Jerdonek)
While working on #32917, I noticed that BaseForm._clean_fields() and BaseForm.changed_data don't currently access their values through a BoundField object. It would be better for consi... | Here is how to make the failing test I mentioned above (roughly): def test_datetime_clean_initial_callable_disabled(self): - now = datetime.datetime(2006, 10, 25, 14, 30, 45, 123456) - class DateTimeForm(forms.Form): - dt = DateTimeField(initial=lambda: now, disabled=True) + dt = DateTimeField(initial=datetime.datetime... | 2021-07-13T09:16:48Z | 4.0 | ["The cleaned value for a form with a disabled DateTimeField and callable", "Cleaning a form with a disabled DateTimeField and callable initial"] | ["test_attribute_class (forms_tests.tests.test_forms.RendererTests)", "test_attribute_instance (forms_tests.tests.test_forms.RendererTests)", "test_attribute_override (forms_tests.tests.test_forms.RendererTests)", "test_default (forms_tests.tests.test_forms.RendererTests)", "test_kwarg_class (forms_tests.tests.test_for... | 475cffd1d64c690cdad16ede4d5e81985738ceb4 | 1-4 hours |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 9