repo stringclasses 12
values | instance_id stringlengths 17 32 | base_commit stringlengths 40 40 | patch stringlengths 344 4.93k | test_patch stringlengths 394 14.4k | problem_statement stringlengths 676 25.2k | hints_text stringlengths 0 59.9k | created_at stringdate 2012-09-20 15:48:00 2023-07-17 20:28:41 | version stringclasses 52
values | FAIL_TO_PASS stringlengths 12 25.6k | PASS_TO_PASS stringlengths 2 124k | environment_setup_commit stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
astropy/astropy | astropy__astropy-12907 | d16bfe05a744909de4b27f5875fe0d4ed41ce607 | diff --git a/astropy/modeling/separable.py b/astropy/modeling/separable.py
--- a/astropy/modeling/separable.py
+++ b/astropy/modeling/separable.py
@@ -242,7 +242,7 @@ def _cstack(left, right):
cright = _coord_matrix(right, 'right', noutp)
else:
cright = np.zeros((noutp, right.shape[1]))
- ... | diff --git a/astropy/modeling/tests/test_separable.py b/astropy/modeling/tests/test_separable.py
--- a/astropy/modeling/tests/test_separable.py
+++ b/astropy/modeling/tests/test_separable.py
@@ -28,6 +28,13 @@
p1 = models.Polynomial1D(1, name='p1')
+cm_4d_expected = (np.array([False, False, True, True]),
+ ... | Modeling's `separability_matrix` does not compute separability correctly for nested CompoundModels
Consider the following model:
```python
from astropy.modeling import models as m
from astropy.modeling.separable import separability_matrix
cm = m.Linear1D(10) & m.Linear1D(5)
```
It's separability matrix as y... | 2022-03-03T15:14:54Z | 4.3 | ["astropy/modeling/tests/test_separable.py::test_separable[compound_model6-result6]", "astropy/modeling/tests/test_separable.py::test_separable[compound_model9-result9]"] | ["astropy/modeling/tests/test_separable.py::test_coord_matrix", "astropy/modeling/tests/test_separable.py::test_cdot", "astropy/modeling/tests/test_separable.py::test_cstack", "astropy/modeling/tests/test_separable.py::test_arith_oper", "astropy/modeling/tests/test_separable.py::test_separable[compound_model0-result0]"... | 298ccb478e6bf092953bca67a3d29dc6c35f6752 | |
astropy/astropy | astropy__astropy-14182 | a5917978be39d13cd90b517e1de4e7a539ffaa48 | diff --git a/astropy/io/ascii/rst.py b/astropy/io/ascii/rst.py
--- a/astropy/io/ascii/rst.py
+++ b/astropy/io/ascii/rst.py
@@ -27,7 +27,6 @@ def get_fixedwidth_params(self, line):
class SimpleRSTData(FixedWidthData):
- start_line = 3
end_line = -1
splitter_class = FixedWidthTwoLineDataSplitter
@@ -3... | diff --git a/astropy/io/ascii/tests/test_rst.py b/astropy/io/ascii/tests/test_rst.py
--- a/astropy/io/ascii/tests/test_rst.py
+++ b/astropy/io/ascii/tests/test_rst.py
@@ -2,7 +2,11 @@
from io import StringIO
+import numpy as np
+
+import astropy.units as u
from astropy.io import ascii
+from astropy.table import Q... | Please support header rows in RestructuredText output
### Description
It would be great if the following would work:
```Python
>>> from astropy.table import QTable
>>> import astropy.units as u
>>> import sys
>>> tbl = QTable({'wave': [350,950]*u.nm, 'response': [0.7, 1.2]*u.count})
>>> tbl.write(sys.stdout,... | 2022-12-16T11:13:37Z | 5.1 | ["astropy/io/ascii/tests/test_rst.py::test_rst_with_header_rows"] | ["astropy/io/ascii/tests/test_rst.py::test_read_normal", "astropy/io/ascii/tests/test_rst.py::test_read_normal_names", "astropy/io/ascii/tests/test_rst.py::test_read_normal_names_include", "astropy/io/ascii/tests/test_rst.py::test_read_normal_exclude", "astropy/io/ascii/tests/test_rst.py::test_read_unbounded_right_colu... | 5f74eacbcc7fff707a44d8eb58adaa514cb7dcb5 | |
astropy/astropy | astropy__astropy-14365 | 7269fa3e33e8d02485a647da91a5a2a60a06af61 | diff --git a/astropy/io/ascii/qdp.py b/astropy/io/ascii/qdp.py
--- a/astropy/io/ascii/qdp.py
+++ b/astropy/io/ascii/qdp.py
@@ -68,7 +68,7 @@ def _line_type(line, delimiter=None):
_new_re = rf"NO({sep}NO)+"
_data_re = rf"({_decimal_re}|NO|[-+]?nan)({sep}({_decimal_re}|NO|[-+]?nan))*)"
_type_re = rf"^\s*((... | diff --git a/astropy/io/ascii/tests/test_qdp.py b/astropy/io/ascii/tests/test_qdp.py
--- a/astropy/io/ascii/tests/test_qdp.py
+++ b/astropy/io/ascii/tests/test_qdp.py
@@ -43,7 +43,18 @@ def test_get_tables_from_qdp_file(tmp_path):
assert np.isclose(table2["MJD_nerr"][0], -2.37847222222222e-05)
-def test_roundt... | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | Welcome to Astropy 👋 and thank you for your first issue!
A project member will respond to you as soon as possible; in the meantime, please double-check the [guidelines for submitting issues](https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md#reporting-issues) and make sure you've provided the requested deta... | 2023-02-06T19:20:34Z | 5.1 | ["astropy/io/ascii/tests/test_qdp.py::test_roundtrip[True]"] | ["astropy/io/ascii/tests/test_qdp.py::test_get_tables_from_qdp_file", "astropy/io/ascii/tests/test_qdp.py::test_roundtrip[False]", "astropy/io/ascii/tests/test_qdp.py::test_read_example", "astropy/io/ascii/tests/test_qdp.py::test_roundtrip_example", "astropy/io/ascii/tests/test_qdp.py::test_roundtrip_example_comma", "a... | 5f74eacbcc7fff707a44d8eb58adaa514cb7dcb5 |
astropy/astropy | astropy__astropy-14995 | b16c7d12ccbc7b2d20364b89fb44285bcbfede54 | diff --git a/astropy/nddata/mixins/ndarithmetic.py b/astropy/nddata/mixins/ndarithmetic.py
--- a/astropy/nddata/mixins/ndarithmetic.py
+++ b/astropy/nddata/mixins/ndarithmetic.py
@@ -520,10 +520,10 @@ def _arithmetic_mask(self, operation, operand, handle_mask, axis=None, **kwds):
elif self.mask is None and ope... | diff --git a/astropy/nddata/mixins/tests/test_ndarithmetic.py b/astropy/nddata/mixins/tests/test_ndarithmetic.py
--- a/astropy/nddata/mixins/tests/test_ndarithmetic.py
+++ b/astropy/nddata/mixins/tests/test_ndarithmetic.py
@@ -1310,3 +1310,42 @@ def test_raise_method_not_supported():
# raise error for unsupported ... | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | Welcome to Astropy 👋 and thank you for your first issue!
A project member will respond to you as soon as possible; in the meantime, please double-check the [guidelines for submitting issues](https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md#reporting-issues) and make sure you've provided the requested deta... | 2023-06-27T19:48:18Z | 5.2 | ["astropy/nddata/mixins/tests/test_ndarithmetic.py::test_nddata_bitmask_arithmetic"] | ["astropy/nddata/mixins/tests/test_ndarithmetic.py::test_arithmetics_data[data10-data20]", "astropy/nddata/mixins/tests/test_ndarithmetic.py::test_arithmetics_data[data11-data21]", "astropy/nddata/mixins/tests/test_ndarithmetic.py::test_arithmetics_data[data12-data22]", "astropy/nddata/mixins/tests/test_ndarithmetic.py... | 362f6df12abf9bd769d4915fabf955c993ea22cf |
astropy/astropy | astropy__astropy-6938 | c76af9ed6bb89bfba45b9f5bc1e635188278e2fa | diff --git a/astropy/io/fits/fitsrec.py b/astropy/io/fits/fitsrec.py
--- a/astropy/io/fits/fitsrec.py
+++ b/astropy/io/fits/fitsrec.py
@@ -1261,7 +1261,7 @@ def _scale_back_ascii(self, col_idx, input_field, output_field):
# Replace exponent separator in floating point numbers
if 'D' in format:
- ... | diff --git a/astropy/io/fits/tests/test_checksum.py b/astropy/io/fits/tests/test_checksum.py
--- a/astropy/io/fits/tests/test_checksum.py
+++ b/astropy/io/fits/tests/test_checksum.py
@@ -205,9 +205,9 @@ def test_ascii_table_data(self):
# The checksum ends up being different on Windows, possibly due
... | Possible bug in io.fits related to D exponents
I came across the following code in ``fitsrec.py``:
```python
# Replace exponent separator in floating point numbers
if 'D' in format:
output_field.replace(encode_ascii('E'), encode_ascii('D'))
```
I think this may be incorrect because... | It is tested with `astropy/io/fits/tests/test_checksum.py:test_ascii_table_data` but indeed the operation is not inplace and it does not fail. Using 'D' is probably better, but since #5362 (I had vague memory about something like this ^^, see also #5353) anyway 'D' and 'E' are read as double, so I think there is not di... | 2017-12-07T00:01:14Z | 1.3 | ["astropy/io/fits/tests/test_checksum.py::TestChecksumFunctions::test_ascii_table_data", "astropy/io/fits/tests/test_table.py::TestTableFunctions::test_ascii_table"] | ["astropy/io/fits/tests/test_checksum.py::TestChecksumFunctions::test_sample_file", "astropy/io/fits/tests/test_checksum.py::TestChecksumFunctions::test_image_create", "astropy/io/fits/tests/test_checksum.py::TestChecksumFunctions::test_scaled_data", "astropy/io/fits/tests/test_checksum.py::TestChecksumFunctions::test_... | 848c8fa21332abd66b44efe3cb48b72377fb32cc |
astropy/astropy | astropy__astropy-7746 | d5bd3f68bb6d5ce3a61bdce9883ee750d1afade5 | diff --git a/astropy/wcs/wcs.py b/astropy/wcs/wcs.py
--- a/astropy/wcs/wcs.py
+++ b/astropy/wcs/wcs.py
@@ -1212,6 +1212,9 @@ def _array_converter(self, func, sky, *args, ra_dec_order=False):
"""
def _return_list_of_arrays(axes, origin):
+ if any([x.size == 0 for x in axes]):
+ ... | diff --git a/astropy/wcs/tests/test_wcs.py b/astropy/wcs/tests/test_wcs.py
--- a/astropy/wcs/tests/test_wcs.py
+++ b/astropy/wcs/tests/test_wcs.py
@@ -1093,3 +1093,21 @@ def test_keyedsip():
assert isinstance( w.sip, wcs.Sip )
assert w.sip.crpix[0] == 2048
assert w.sip.crpix[1] == 1026
+
+
+def test_zero... | Issue when passing empty lists/arrays to WCS transformations
The following should not fail but instead should return empty lists/arrays:
```
In [1]: from astropy.wcs import WCS
In [2]: wcs = WCS('2MASS_h.fits')
In [3]: wcs.wcs_pix2world([], [], 0)
-------------------------------------------------------------... | 2018-08-20T14:07:20Z | 1.3 | ["astropy/wcs/tests/test_wcs.py::test_zero_size_input"] | ["astropy/wcs/tests/test_wcs.py::TestMaps::test_consistency", "astropy/wcs/tests/test_wcs.py::TestMaps::test_maps", "astropy/wcs/tests/test_wcs.py::TestSpectra::test_consistency", "astropy/wcs/tests/test_wcs.py::TestSpectra::test_spectra", "astropy/wcs/tests/test_wcs.py::test_fixes", "astropy/wcs/tests/test_wcs.py::tes... | 848c8fa21332abd66b44efe3cb48b72377fb32cc | |
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 |
django/django | django__django-10924 | bceadd2788dc2dad53eba0caae172bd8522fd483 | 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
@@ -1709,7 +1709,7 @@ def get_prep_value(self, value):
def formfield(self, **kwargs):
return super().formfield(**{
- 'path... | diff --git a/tests/model_fields/test_filepathfield.py b/tests/model_fields/test_filepathfield.py
new file mode 100644
--- /dev/null
+++ b/tests/model_fields/test_filepathfield.py
@@ -0,0 +1,22 @@
+import os
+
+from django.db.models import FilePathField
+from django.test import SimpleTestCase
+
+
+class FilePathFieldTes... | Allow FilePathField path to accept a callable.
Description
I have a special case where I want to create a model containing the path to some local files on the server/dev machine. Seeing as the place where these files are stored is different on different machines I have the following:
import os
from django.conf import... | So, to clarify, what exactly is the bug/feature proposal/issue here? The way I see it, you're supposed to use os.path.join() and LOCAL_FILE_DIR to define a relative path. It's sort of like how we use BASE_DIR to define relative paths in a lot of other places. Could you please clarify a bit more as to what the issue is ... | 2019-02-03T11:30:12Z | 3.0 | ["test_callable_path (model_fields.test_filepathfield.FilePathFieldTests)"] | ["test_path (model_fields.test_filepathfield.FilePathFieldTests)"] | 419a78300f7cd27611196e1e464d50fd0385ff27 |
django/django | django__django-11001 | ef082ebb84f00e38af4e8880d04e8365c2766d34 | diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -32,7 +32,8 @@ def __init__(self, query, connection, using):
self.select = None
self.annotation_col_map = None
self.klass_info = No... | diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py
--- a/tests/expressions/tests.py
+++ b/tests/expressions/tests.py
@@ -384,6 +384,29 @@ def test_order_by_exists(self):
)
self.assertSequenceEqual(mustermanns_by_seniority, [self.max, mary])
+ def test_order_by_multiline_sql(self... | Incorrect removal of order_by clause created as multiline RawSQL
Description
Hi.
The SQLCompiler is ripping off one of my "order by" clause, because he "thinks" the clause was already "seen" (in SQLCompiler.get_order_by()). I'm using expressions written as multiline RawSQLs, which are similar but not the same.
The b... | Is there a reason you can't use conditional expressions, e.g. something like: MyModel.objects.annotate( custom_order=Case( When(...), ) ).order_by('custom_order') I'm thinking that would avoid fiddly ordering_parts regular expression. If there's some shortcoming to that approach, it might be easier to address that. Al... | 2019-02-17T13:02:09Z | 3.0 | ["test_order_by_multiline_sql (expressions.tests.BasicExpressionsTests)", "test_order_of_operations (expressions.tests.BasicExpressionsTests)"] | ["test_deconstruct (expressions.tests.FTests)", "test_deepcopy (expressions.tests.FTests)", "test_equal (expressions.tests.FTests)", "test_hash (expressions.tests.FTests)", "test_not_equal_Value (expressions.tests.FTests)", "test_and (expressions.tests.CombinableTests)", "test_negation (expressions.tests.CombinableTest... | 419a78300f7cd27611196e1e464d50fd0385ff27 |
django/django | django__django-11019 | 93e892bb645b16ebaf287beb5fe7f3ffe8d10408 | diff --git a/django/forms/widgets.py b/django/forms/widgets.py
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -6,16 +6,21 @@
import datetime
import re
import warnings
+from collections import defaultdict
from itertools import chain
from django.conf import settings
from django.forms.utils import ... | diff --git a/tests/admin_inlines/tests.py b/tests/admin_inlines/tests.py
--- a/tests/admin_inlines/tests.py
+++ b/tests/admin_inlines/tests.py
@@ -497,10 +497,10 @@ def test_inline_media_only_inline(self):
response.context['inline_admin_formsets'][0].media._js,
[
'admin/js/ven... | Merging 3 or more media objects can throw unnecessary MediaOrderConflictWarnings
Description
Consider the following form definition, where text-editor-extras.js depends on text-editor.js but all other JS files are independent:
from django import forms
class ColorPicker(forms.Widget):
class Media:
js = ['color-pick... | As a tentative fix, I propose that media objects should explicitly distinguish between cases where we do / don't care about ordering, notionally something like: class FancyTextWidget(forms.Widget): class Media: js = { ('text-editor.js', 'text-editor-extras.js'), # tuple = order is important 'color-picker.js' # set = or... | 2019-02-23T15:51:14Z | 3.0 | ["test_combine_media (forms_tests.tests.test_media.FormsMediaTestCase)", "test_construction (forms_tests.tests.test_media.FormsMediaTestCase)", "test_form_media (forms_tests.tests.test_media.FormsMediaTestCase)", "test_media_deduplication (forms_tests.tests.test_media.FormsMediaTestCase)", "test_media_inheritance (form... | ["Regression for #9362", "test_html_safe (forms_tests.tests.test_media.FormsMediaTestCase)", "test_media_dsl (forms_tests.tests.test_media.FormsMediaTestCase)", "test_media_inheritance_from_property (forms_tests.tests.test_media.FormsMediaTestCase)", "test_media_inheritance_single_type (forms_tests.tests.test_media.For... | 419a78300f7cd27611196e1e464d50fd0385ff27 |
django/django | django__django-11039 | d5276398046ce4a102776a1e67dcac2884d80dfe | diff --git a/django/core/management/commands/sqlmigrate.py b/django/core/management/commands/sqlmigrate.py
--- a/django/core/management/commands/sqlmigrate.py
+++ b/django/core/management/commands/sqlmigrate.py
@@ -55,8 +55,9 @@ def handle(self, *args, **options):
migration_name, app_label))
t... | diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py
--- a/tests/migrations/test_commands.py
+++ b/tests/migrations/test_commands.py
@@ -536,7 +536,13 @@ def test_sqlmigrate_forwards(self):
index_op_desc_unique_together = output.find('-- alter unique_together')
index_tx_e... | sqlmigrate wraps it's outpout in BEGIN/COMMIT even if the database doesn't support transactional DDL
Description
(last modified by Simon Charette)
The migration executor only adds the outer BEGIN/COMMIT if the migration is atomic and the schema editor can rollback DDL but the current sqlmigrate logic only tak... | I marked the ticket as easy picking because I included the above guidelines but feel free to uncheck it if you deem it inappropriate. Super. We don't have enough Easy Pickings tickets for the demand, so this kind of thing is great. (IMO 🙂)
Hey, I'm working on this ticket, I would like you to know as this is my first t... | 2019-03-01T10:24:38Z | 3.0 | ["test_sqlmigrate_for_non_transactional_databases (migrations.test_commands.MigrateTests)"] | ["test_makemigrations_app_name_specified_as_label (migrations.test_commands.AppLabelErrorTests)", "test_makemigrations_nonexistent_app_label (migrations.test_commands.AppLabelErrorTests)", "test_migrate_app_name_specified_as_label (migrations.test_commands.AppLabelErrorTests)", "test_migrate_nonexistent_app_label (migr... | 419a78300f7cd27611196e1e464d50fd0385ff27 |
django/django | django__django-11049 | 17455e924e243e7a55e8a38f45966d8cbb27c273 | 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
@@ -1587,7 +1587,7 @@ class DurationField(Field):
empty_strings_allowed = False
default_error_messages = {
'invalid': _("'%(value)... | diff --git a/tests/model_fields/test_durationfield.py b/tests/model_fields/test_durationfield.py
--- a/tests/model_fields/test_durationfield.py
+++ b/tests/model_fields/test_durationfield.py
@@ -75,7 +75,7 @@ def test_invalid_string(self):
self.assertEqual(
cm.exception.message % cm.exception.para... | Correct expected format in invalid DurationField error message
Description
If you enter a duration "14:00" into a duration field, it translates to "00:14:00" which is 14 minutes.
The current error message for invalid DurationField says that this should be the format of durations: "[DD] [HH:[MM:]]ss[.uuuuuu]". But acc... | 2019-03-03T09:56:16Z | 3.0 | ["test_invalid_string (model_fields.test_durationfield.TestValidation)"] | ["test_dumping (model_fields.test_durationfield.TestSerialization)", "test_loading (model_fields.test_durationfield.TestSerialization)", "test_formfield (model_fields.test_durationfield.TestFormField)", "test_exact (model_fields.test_durationfield.TestQuerying)", "test_gt (model_fields.test_durationfield.TestQuerying)"... | 419a78300f7cd27611196e1e464d50fd0385ff27 | |
django/django | django__django-11099 | d26b2424437dabeeca94d7900b37d2df4410da0c | diff --git a/django/contrib/auth/validators.py b/django/contrib/auth/validators.py
--- a/django/contrib/auth/validators.py
+++ b/django/contrib/auth/validators.py
@@ -7,7 +7,7 @@
@deconstructible
class ASCIIUsernameValidator(validators.RegexValidator):
- regex = r'^[\w.@+-]+$'
+ regex = r'^[\w.@+-]+\Z'
m... | diff --git a/tests/auth_tests/test_validators.py b/tests/auth_tests/test_validators.py
--- a/tests/auth_tests/test_validators.py
+++ b/tests/auth_tests/test_validators.py
@@ -237,7 +237,7 @@ def test_unicode_validator(self):
invalid_usernames = [
"o'connell", "عبد ال",
"zerowidth\u200... | UsernameValidator allows trailing newline in usernames
Description
ASCIIUsernameValidator and UnicodeUsernameValidator use the regex
r'^[\w.@+-]+$'
The intent is to only allow alphanumeric characters as well as ., @, +, and -. However, a little known quirk of Python regexes is that $ will also match a trailing newli... | 2019-03-20T03:46:18Z | 3.0 | ["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_help_text (auth_tests.test_validators.MinimumLengthValidatorTest)", "test_validate (auth_tests.test_validators.MinimumLengthValidatorTest)", "test_help_text (auth_tests.test_validators.NumericPasswordValidatorTest)", "test_validate (auth_tests.test_validators.NumericPasswordValidatorTest)", "test_validate (auth_... | 419a78300f7cd27611196e1e464d50fd0385ff27 | |
django/django | django__django-11133 | 879cc3da6249e920b8d54518a0ae06de835d7373 | diff --git a/django/http/response.py b/django/http/response.py
--- a/django/http/response.py
+++ b/django/http/response.py
@@ -229,7 +229,7 @@ def make_bytes(self, value):
# Handle string types -- we can't rely on force_bytes here because:
# - Python attempts str conversion first
# - when sel... | diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py
--- a/tests/httpwrappers/tests.py
+++ b/tests/httpwrappers/tests.py
@@ -366,6 +366,10 @@ def test_non_string_content(self):
r.content = 12345
self.assertEqual(r.content, b'12345')
+ def test_memoryview_content(self):
+ ... | HttpResponse doesn't handle memoryview objects
Description
I am trying to write a BinaryField retrieved from the database into a HttpResponse. When the database is Sqlite this works correctly, but Postgresql returns the contents of the field as a memoryview object and it seems like current Django doesn't like this co... | I guess HttpResponseBase.make_bytes could be adapted to deal with memoryview objects by casting them to bytes. In all cases simply wrapping the memoryview in bytes works as a workaround HttpResponse(bytes(model.binary_field)).
The fact make_bytes would still use force_bytes if da56e1bac6449daef9aeab8d076d2594d9fd5b44 ... | 2019-03-27T06:48:09Z | 3.0 | ["test_memoryview_content (httpwrappers.tests.HttpResponseTests)"] | ["test_streaming_response (httpwrappers.tests.StreamingHttpResponseTests)", "test_cookie_edgecases (httpwrappers.tests.CookieTests)", "Semicolons and commas are decoded.", "Semicolons and commas are encoded.", "test_httponly_after_load (httpwrappers.tests.CookieTests)", "test_invalid_cookies (httpwrappers.tests.CookieT... | 419a78300f7cd27611196e1e464d50fd0385ff27 |
django/django | django__django-11179 | 19fc6376ce67d01ca37a91ef2f55ef769f50513a | diff --git a/django/db/models/deletion.py b/django/db/models/deletion.py
--- a/django/db/models/deletion.py
+++ b/django/db/models/deletion.py
@@ -277,6 +277,7 @@ def delete(self):
if self.can_fast_delete(instance):
with transaction.mark_for_rollback_on_error():
count ... | diff --git a/tests/delete/tests.py b/tests/delete/tests.py
--- a/tests/delete/tests.py
+++ b/tests/delete/tests.py
@@ -1,6 +1,7 @@
from math import ceil
from django.db import IntegrityError, connection, models
+from django.db.models.deletion import Collector
from django.db.models.sql.constants import GET_ITERATOR_... | delete() on instances of models without any dependencies doesn't clear PKs.
Description
Deleting any model with no dependencies not updates the PK on the model. It should be set to None after .delete() call.
See Django.db.models.deletion:276-281. Should update the model line 280.
Actually, do not fix this issue, beca... | Reproduced at 1ffddfc233e2d5139cc6ec31a4ec6ef70b10f87f. Regression in bc7dd8490b882b2cefdc7faf431dc64c532b79c9. Thanks for the report.
Regression test.
I have attached a simple fix which mimics what https://github.com/django/django/blob/master/django/db/models/deletion.py#L324-L326 does for multiple objects. I am not ... | 2019-04-05T15:54:39Z | 3.0 | ["test_fast_delete_instance_set_pk_none (delete.tests.FastDeleteTests)"] | ["test_fast_delete_empty_no_update_can_self_select (delete.tests.FastDeleteTests)", "test_fast_delete_fk (delete.tests.FastDeleteTests)", "test_fast_delete_inheritance (delete.tests.FastDeleteTests)", "test_fast_delete_joined_qs (delete.tests.FastDeleteTests)", "test_fast_delete_large_batch (delete.tests.FastDeleteTest... | 419a78300f7cd27611196e1e464d50fd0385ff27 |
django/django | django__django-11283 | 08a4ee06510ae45562c228eefbdcaac84bd38c7a | diff --git a/django/contrib/auth/migrations/0011_update_proxy_permissions.py b/django/contrib/auth/migrations/0011_update_proxy_permissions.py
--- a/django/contrib/auth/migrations/0011_update_proxy_permissions.py
+++ b/django/contrib/auth/migrations/0011_update_proxy_permissions.py
@@ -1,5 +1,18 @@
-from django.db impo... | diff --git a/tests/auth_tests/test_migrations.py b/tests/auth_tests/test_migrations.py
--- a/tests/auth_tests/test_migrations.py
+++ b/tests/auth_tests/test_migrations.py
@@ -4,6 +4,7 @@
from django.contrib.auth.models import Permission, User
from django.contrib.contenttypes.models import ContentType
from django.tes... | Migration auth.0011_update_proxy_permissions fails for models recreated as a proxy.
Description
(last modified by Mariusz Felisiak)
I am trying to update my project to Django 2.2. When I launch python manage.py migrate, I get this error message when migration auth.0011_update_proxy_permissions is applying (full... | Please provide a sample project or enough details to reproduce the issue.
Same problem for me. If a Permission exists already with the new content_type and permission name, IntegrityError is raised since it violates the unique_key constraint on permission model i.e. content_type_id_code_name
To get into the situation w... | 2019-04-26T07:02:50Z | 3.0 | ["test_migrate_with_existing_target_permission (auth_tests.test_migrations.ProxyModelWithSameAppLabelTests)"] | ["test_migrate_backwards (auth_tests.test_migrations.ProxyModelWithDifferentAppLabelTests)", "test_proxy_model_permissions_contenttype (auth_tests.test_migrations.ProxyModelWithDifferentAppLabelTests)", "test_user_has_now_proxy_model_permissions (auth_tests.test_migrations.ProxyModelWithDifferentAppLabelTests)", "test_... | 419a78300f7cd27611196e1e464d50fd0385ff27 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 10