repo stringclasses 1
value | instance_id stringlengths 20 20 | base_commit stringlengths 40 40 | patch stringlengths 397 10.8k | test_patch stringlengths 542 11.2k | problem_statement stringlengths 190 6.76k | hints_text stringlengths 0 13.8k | created_at stringdate 2018-06-26 23:30:51 2023-07-17 20:28:41 | version stringclasses 8
values | FAIL_TO_PASS stringlengths 39 32.6k | PASS_TO_PASS stringlengths 2 107k | environment_setup_commit stringclasses 8
values | difficulty stringclasses 3
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
django/django | django__django-10097 | b9cf764be62e77b4777b3a75ec256f6209a57671 | diff --git a/django/core/validators.py b/django/core/validators.py
--- a/django/core/validators.py
+++ b/django/core/validators.py
@@ -94,7 +94,7 @@ class URLValidator(RegexValidator):
regex = _lazy_re_compile(
r'^(?:[a-z0-9\.\-\+]*)://' # scheme is validated separately
- r'(?:\S+(?::\S*)?@)?' ... | diff --git a/tests/validators/invalid_urls.txt b/tests/validators/invalid_urls.txt
--- a/tests/validators/invalid_urls.txt
+++ b/tests/validators/invalid_urls.txt
@@ -57,3 +57,9 @@ http://example.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.
http://example.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | Make URLValidator reject invalid characters in the username and password
Description
(last modified by Tim Bell)
Since #20003, core.validators.URLValidator accepts URLs with usernames and passwords. RFC 1738 section 3.1 requires "Within the user and password field, any ":", "@", or "/" must be encoded"; however... | 2018-06-26T23:30:51Z | 2.2 | ["test_ascii_validator (auth_tests.test_validators.UsernameValidatorsTests)", "test_unicode_validator (auth_tests.test_validators.UsernameValidatorsTests)", "test_help_text (auth_tests.test_validators.UserAttributeSimilarityValidatorTest)", "test_validate (auth_tests.test_validators.UserAttributeSimilarityValidatorTest... | ["test_defaults (str.tests.SimpleTests)", "test_international (str.tests.SimpleTests)", "test_default (model_fields.test_decimalfield.DecimalFieldTests)", "test_filter_with_strings (model_fields.test_decimalfield.DecimalFieldTests)", "test_get_prep_value (model_fields.test_decimalfield.DecimalFieldTests)", "test_lookup... | 4fc35a9c3efdc9154efce28cb23cb84f8834517e | <15 min fix | |
django/django | django__django-10914 | e7fd69d051eaa67cb17f172a39b57253e9cb831a | diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py
--- a/django/conf/global_settings.py
+++ b/django/conf/global_settings.py
@@ -304,7 +304,7 @@ def gettext_noop(s):
# The numeric mode to set newly-uploaded files to. The value should be a mode
# you'd pass directly to os.chmod; see https:/... | diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py
--- a/tests/test_utils/tests.py
+++ b/tests/test_utils/tests.py
@@ -1099,7 +1099,7 @@ def test_override_file_upload_permissions(self):
the file_permissions_mode attribute of
django.core.files.storage.default_storage.
"""
- ... | Set default FILE_UPLOAD_PERMISSION to 0o644.
Description
Hello,
As far as I can see, the File Uploads documentation page does not mention any permission issues.
What I would like to see is a warning that in absence of explicitly configured FILE_UPLOAD_PERMISSIONS, the permissions for a file uploaded to FileSystemSto... | I think you're talking about ef70af77ec53160d5ffa060c1bdf5ed93322d84f (#28540). I guess the question is whether or not that documentation should be duplicated elsewhere.
Thank you Tim, this is precisely what I was looking for! I can only see one issue with the current docs (if you excuse me for bothering you with such ... | 2019-01-30T13:13:20Z | 3.0 | ["test_override_file_upload_permissions (test_utils.tests.OverrideSettingsTests)"] | ["test_allowed_database_chunked_cursor_queries (test_utils.tests.AllowedDatabaseQueriesTests)", "test_allowed_database_queries (test_utils.tests.AllowedDatabaseQueriesTests)", "test_skip_if_db_feature (test_utils.tests.SkippingTestCase)", "test_skip_unless_db_feature (test_utils.tests.SkippingTestCase)", "test_equal_pa... | 419a78300f7cd27611196e1e464d50fd0385ff27 | <15 min fix |
django/django | django__django-11066 | 4b45b6c8e4d7c9701a332e80d3b1c84209dc36e2 | diff --git a/django/contrib/contenttypes/management/__init__.py b/django/contrib/contenttypes/management/__init__.py
--- a/django/contrib/contenttypes/management/__init__.py
+++ b/django/contrib/contenttypes/management/__init__.py
@@ -24,7 +24,7 @@ def _rename(self, apps, schema_editor, old_model, new_model):
... | diff --git a/tests/contenttypes_tests/test_operations.py b/tests/contenttypes_tests/test_operations.py
--- a/tests/contenttypes_tests/test_operations.py
+++ b/tests/contenttypes_tests/test_operations.py
@@ -14,11 +14,16 @@
),
)
class ContentTypeOperationsTests(TransactionTestCase):
+ databases = {'default', '... | RenameContentType._rename() doesn't save the content type on the correct database
Description
The commit in question:
https://github.com/django/django/commit/f179113e6cbc8ba0a8d4e87e1d4410fb61d63e75
The specific lines in question:
https://github.com/django/django/blob/586a9dc4295357de1f5ad0590ad34bf2bc008f79/django... | Added a pull request with the fix. https://github.com/django/django/pull/10332
Hi, I spent all afternoon into this ticket. As I am a newbie I failed to make a test for it. And the fix can really be 'using=db' in the .save() method. But I found a StackOverflow answer about transaction.atomic(using=db) that is interesti... | 2019-03-09T13:03:14Z | 3.0 | ["test_existing_content_type_rename_other_database (contenttypes_tests.test_operations.ContentTypeOperationsTests)"] | ["test_content_type_rename_conflict (contenttypes_tests.test_operations.ContentTypeOperationsTests)", "test_existing_content_type_rename (contenttypes_tests.test_operations.ContentTypeOperationsTests)", "test_missing_content_type_rename_ignore (contenttypes_tests.test_operations.ContentTypeOperationsTests)"] | 419a78300f7cd27611196e1e464d50fd0385ff27 | <15 min fix |
django/django | django__django-11095 | 7d49ad76562e8c0597a0eb66046ab423b12888d8 | diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
--- a/django/contrib/admin/options.py
+++ b/django/contrib/admin/options.py
@@ -327,6 +327,10 @@ def get_fieldsets(self, request, obj=None):
return self.fieldsets
return [(None, {'fields': self.get_fields(request, obj)}... | diff --git a/tests/generic_inline_admin/tests.py b/tests/generic_inline_admin/tests.py
--- a/tests/generic_inline_admin/tests.py
+++ b/tests/generic_inline_admin/tests.py
@@ -429,3 +429,29 @@ class EpisodeAdmin(admin.ModelAdmin):
inlines = ma.get_inline_instances(request)
for (formset, inline), other_... | add ModelAdmin.get_inlines() hook to allow set inlines based on the request or model instance.
Description
add ModelAdmin.get_inlines() hook to allow set inlines based on the request or model instance.
Currently, We can override the method get_inline_instances to do such a thing, but a for loop should be copied to my... | Are you going to offer a patch to show exactly what you have in mind? I'm not immediately convinced that another hook is needed since the cost of duplicating a for loop is not that great.
If I want to realize a dynamic inlines based on the request or model instance. I need to override get_inline_instances to do it. Wha... | 2019-03-19T15:17:28Z | 3.0 | ["test_get_inline_instances_override_get_inlines (generic_inline_admin.tests.GenericInlineModelAdminTest)"] | ["test_no_deletion (generic_inline_admin.tests.NoInlineDeletionTest)", "test_custom_form_meta_exclude (generic_inline_admin.tests.GenericInlineModelAdminTest)", "test_custom_form_meta_exclude_with_readonly (generic_inline_admin.tests.GenericInlineModelAdminTest)", "test_get_fieldsets (generic_inline_admin.tests.Generic... | 419a78300f7cd27611196e1e464d50fd0385ff27 | 15 min - 1 hour |
django/django | django__django-11119 | d4df5e1b0b1c643fe0fc521add0236764ec8e92a | diff --git a/django/template/engine.py b/django/template/engine.py
--- a/django/template/engine.py
+++ b/django/template/engine.py
@@ -160,7 +160,7 @@ def render_to_string(self, template_name, context=None):
if isinstance(context, Context):
return t.render(context)
else:
- retu... | diff --git a/tests/template_tests/test_engine.py b/tests/template_tests/test_engine.py
--- a/tests/template_tests/test_engine.py
+++ b/tests/template_tests/test_engine.py
@@ -21,6 +21,13 @@ def test_basic_context(self):
'obj:test\n',
)
+ def test_autoescape_off(self):
+ engine = Engine... | Engine.render_to_string() should honor the autoescape attribute
Description
In Engine.render_to_string, a Context is created without specifying the engine autoescape attribute. So if you create en engine with autoescape=False and then call its render_to_string() method, the result will always be autoescaped. It was p... | I'd like to reserve this for an event I'll attend on Oct 4th. | 2019-03-24T21:17:05Z | 3.0 | ["test_autoescape_off (template_tests.test_engine.RenderToStringTest)"] | ["test_cached_loader_priority (template_tests.test_engine.LoaderTests)", "test_loader_priority (template_tests.test_engine.LoaderTests)", "test_origin (template_tests.test_engine.LoaderTests)", "test_basic_context (template_tests.test_engine.RenderToStringTest)", "test_multiple_engines_configured (template_tests.test_e... | 419a78300f7cd27611196e1e464d50fd0385ff27 | <15 min fix |
django/django | django__django-11206 | 571ab44e8a8936014c22e7eebe4948d9611fd7ce | diff --git a/django/utils/numberformat.py b/django/utils/numberformat.py
--- a/django/utils/numberformat.py
+++ b/django/utils/numberformat.py
@@ -27,6 +27,14 @@ def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
# sign
sign = ''
if isinstance(number, Decimal):
+
+ if d... | diff --git a/tests/utils_tests/test_numberformat.py b/tests/utils_tests/test_numberformat.py
--- a/tests/utils_tests/test_numberformat.py
+++ b/tests/utils_tests/test_numberformat.py
@@ -94,7 +94,7 @@ def test_decimal_numbers(self):
('1e-10', 8, '0.00000000'),
('1e-11', 8, '0.00000000'),
... | utils.numberformat.format renders small decimals in exponential notation.
Description
When using utils.number_format with decimal_pos, extremely small numbers get displayed using exponential notation.
>>> from django.utils.numberformat import format as nformat
>>> nformat(Decimal('1e-199'), '.', decimal_pos=2)
'0.00'... | Hi Sjoerd. OK, so this is related to the changes in 9cc6a60040b0f64f8ea066dd215176d4bd16621d. Happy to Accept as a potential Cleanup/optimization — I guess ultimately it depends on what the change looks like. (i.e. is the nicer behaviour worth the extra complexity? etc) I'm assuming you're ready/willing to make the pat... | 2019-04-13T10:19:38Z | 3.0 | ["test_decimal_numbers (utils_tests.test_numberformat.TestNumberFormat)", "test_decimal_subclass (utils_tests.test_numberformat.TestNumberFormat)"] | ["test_float_numbers (utils_tests.test_numberformat.TestNumberFormat)", "test_format_number (utils_tests.test_numberformat.TestNumberFormat)", "test_format_string (utils_tests.test_numberformat.TestNumberFormat)", "test_large_number (utils_tests.test_numberformat.TestNumberFormat)"] | 419a78300f7cd27611196e1e464d50fd0385ff27 | 15 min - 1 hour |
django/django | django__django-11211 | ba726067604ce5a8ca3919edf653496722b433ab | diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -2325,6 +2325,10 @@ def deconstruct(self):
def get_internal_type(self):
return "UUIDField"
+ def get_prep_value(self, value):
+... | diff --git a/tests/prefetch_related/models.py b/tests/prefetch_related/models.py
--- a/tests/prefetch_related/models.py
+++ b/tests/prefetch_related/models.py
@@ -172,6 +172,11 @@ def __str__(self):
return self.tag
+class Article(models.Model):
+ id = models.UUIDField(primary_key=True, default=uuid.uuid... | Prefetch related is not working when used GFK for model that uses UUID field as PK.
Description
How to reproduce:
create model with UUID as primary key
class Foo(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
...
create another model with GFK to model Foo
class Bar(models... | Thanks for the report, however GenericForeignKey doesn't support prefetch_related(), from the same reason it doesn't not support also filter(), exclude(), etc. Please see documentation. | 2019-04-13T12:01:14Z | 3.0 | ["test_prefetch_GFK_uuid_pk (prefetch_related.tests.GenericRelationTests)"] | ["test_bug (prefetch_related.tests.Ticket21410Tests)", "test_basic (prefetch_related.tests.RawQuerySetTests)", "test_clear (prefetch_related.tests.RawQuerySetTests)", "test_prefetch_before_raw (prefetch_related.tests.RawQuerySetTests)", "test_bug (prefetch_related.tests.Ticket19607Tests)", "test_m2m_then_m2m (prefetch_... | 419a78300f7cd27611196e1e464d50fd0385ff27 | 15 min - 1 hour |
django/django | django__django-11239 | d87bd29c4f8dfcdf3f4a4eb8340e6770a2416fe3 | "diff --git a/django/db/backends/postgresql/client.py b/django/db/backends/postgresql/client.py\n---(...TRUNCATED) | "diff --git a/tests/dbshell/test_postgresql.py b/tests/dbshell/test_postgresql.py\n--- a/tests/dbshe(...TRUNCATED) | "Add support for postgresql client certificates and key to dbshell.\nDescription\n\t\nThis bug is ve(...TRUNCATED) | 2019-04-16T09:44:54Z | 3.0 | ["test_ssl_certificate (dbshell.test_postgresql.PostgreSqlDbshellCommandTestCase)"] | "[\"test_accent (dbshell.test_postgresql.PostgreSqlDbshellCommandTestCase)\", \"test_basic (dbshell.(...TRUNCATED) | 419a78300f7cd27611196e1e464d50fd0385ff27 | <15 min fix | |
django/django | django__django-11265 | 21aa2a5e785eef1f47beb1c3760fdd7d8915ae09 | "diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py\n--- a/django/db/models/(...TRUNCATED) | "diff --git a/tests/filtered_relation/tests.py b/tests/filtered_relation/tests.py\n--- a/tests/filte(...TRUNCATED) | "Using exclude on annotated FilteredRelation doesn't work\nDescription\n\t\nIt looks like using excl(...TRUNCATED) | "I've submitted a PR: PR\nPatch looks good but it looks like doesn't qualify for a backport given(...TRUNCATED) | 2019-04-21T12:57:28Z | 3.0 | ["test_with_exclude (filtered_relation.tests.FilteredRelationTests)"] | "[\"test_aggregate (filtered_relation.tests.FilteredRelationAggregationTests)\", \"test_as_subquery (...TRUNCATED) | 419a78300f7cd27611196e1e464d50fd0385ff27 | 15 min - 1 hour |
django/django | django__django-11333 | 55b68de643b5c2d5f0a8ea7587ab3b2966021ccc | "diff --git a/django/urls/base.py b/django/urls/base.py\n--- a/django/urls/base.py\n+++ b/django/url(...TRUNCATED) | "diff --git a/tests/urlpatterns/test_resolvers.py b/tests/urlpatterns/test_resolvers.py\n--- a/tests(...TRUNCATED) | "Optimization: Multiple URLResolvers may be unintentionally be constructed by calls to `django.urls.(...TRUNCATED) | "I'm planning to contribute a fix, as soon as I can get the CLA signed. Hi. Great. Happy to provisio(...TRUNCATED) | 2019-05-06T21:00:53Z | 3.0 | ["test_resolver_cache_default__root_urlconf (urlpatterns.test_resolvers.ResolverCacheTests)"] | "[\"test_str (urlpatterns.test_resolvers.RegexPatternTests)\", \"test_str (urlpatterns.test_resolver(...TRUNCATED) | 419a78300f7cd27611196e1e464d50fd0385ff27 | 15 min - 1 hour |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 16