Search is not available for this dataset
identifier stringlengths 1 155 | parameters stringlengths 2 6.09k | docstring stringlengths 11 63.4k | docstring_summary stringlengths 0 63.4k | function stringlengths 29 99.8k | function_tokens list | start_point list | end_point list | language stringclasses 1
value | docstring_language stringlengths 2 7 | docstring_language_predictions stringlengths 18 23 | is_langid_reliable stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
Resolver.resolve | (self, requirements, max_rounds=100) | Take a collection of constraints, spit out the resolution result.
The return value is a representation to the final resolution result. It
is a tuple subclass with three public members:
* `mapping`: A dict of resolved candidates. Each key is an identifier
of a requirement (as return... | Take a collection of constraints, spit out the resolution result. | def resolve(self, requirements, max_rounds=100):
"""Take a collection of constraints, spit out the resolution result.
The return value is a representation to the final resolution result. It
is a tuple subclass with three public members:
* `mapping`: A dict of resolved candidates. Each ... | [
"def",
"resolve",
"(",
"self",
",",
"requirements",
",",
"max_rounds",
"=",
"100",
")",
":",
"resolution",
"=",
"Resolution",
"(",
"self",
".",
"provider",
",",
"self",
".",
"reporter",
")",
"state",
"=",
"resolution",
".",
"resolve",
"(",
"requirements",
... | [
383,
4
] | [
413,
35
] | python | en | ['en', 'en', 'en'] | True |
_hash_dict | (d) | Return a stable sha224 of a dictionary. | Return a stable sha224 of a dictionary. | def _hash_dict(d):
# type: (Dict[str, str]) -> str
"""Return a stable sha224 of a dictionary."""
s = json.dumps(d, sort_keys=True, separators=(",", ":"), ensure_ascii=True)
return hashlib.sha224(s.encode("ascii")).hexdigest() | [
"def",
"_hash_dict",
"(",
"d",
")",
":",
"# type: (Dict[str, str]) -> str",
"s",
"=",
"json",
".",
"dumps",
"(",
"d",
",",
"sort_keys",
"=",
"True",
",",
"separators",
"=",
"(",
"\",\"",
",",
"\":\"",
")",
",",
"ensure_ascii",
"=",
"True",
")",
"return",... | [
31,
0
] | [
35,
56
] | python | en | ['en', 'en', 'en'] | True |
Cache._get_cache_path_parts_legacy | (self, link) | Get parts of part that must be os.path.joined with cache_dir
Legacy cache key (pip < 20) for compatibility with older caches.
| Get parts of part that must be os.path.joined with cache_dir | def _get_cache_path_parts_legacy(self, link):
# type: (Link) -> List[str]
"""Get parts of part that must be os.path.joined with cache_dir
Legacy cache key (pip < 20) for compatibility with older caches.
"""
# We want to generate an url to use as our cache key, we don't want to
... | [
"def",
"_get_cache_path_parts_legacy",
"(",
"self",
",",
"link",
")",
":",
"# type: (Link) -> List[str]",
"# We want to generate an url to use as our cache key, we don't want to",
"# just re-use the URL because it might have other items in the fragment",
"# and we don't care about those.",
"... | [
60,
4
] | [
86,
20
] | python | en | ['en', 'en', 'en'] | True |
Cache._get_cache_path_parts | (self, link) | Get parts of part that must be os.path.joined with cache_dir
| Get parts of part that must be os.path.joined with cache_dir
| def _get_cache_path_parts(self, link):
# type: (Link) -> List[str]
"""Get parts of part that must be os.path.joined with cache_dir
"""
# We want to generate an url to use as our cache key, we don't want to
# just re-use the URL because it might have other items in the fragment
... | [
"def",
"_get_cache_path_parts",
"(",
"self",
",",
"link",
")",
":",
"# type: (Link) -> List[str]",
"# We want to generate an url to use as our cache key, we don't want to",
"# just re-use the URL because it might have other items in the fragment",
"# and we don't care about those.",
"key_par... | [
88,
4
] | [
121,
20
] | python | en | ['en', 'en', 'en'] | True |
Cache.get_path_for_link | (self, link) | Return a directory to store cached items in for link.
| Return a directory to store cached items in for link.
| def get_path_for_link(self, link):
# type: (Link) -> str
"""Return a directory to store cached items in for link.
"""
raise NotImplementedError() | [
"def",
"get_path_for_link",
"(",
"self",
",",
"link",
")",
":",
"# type: (Link) -> str",
"raise",
"NotImplementedError",
"(",
")"
] | [
155,
4
] | [
159,
35
] | python | en | ['en', 'en', 'en'] | True |
Cache.get | (
self,
link, # type: Link
package_name, # type: Optional[str]
supported_tags, # type: List[Tag]
) | Returns a link to a cached item if it exists, otherwise returns the
passed link.
| Returns a link to a cached item if it exists, otherwise returns the
passed link.
| def get(
self,
link, # type: Link
package_name, # type: Optional[str]
supported_tags, # type: List[Tag]
):
# type: (...) -> Link
"""Returns a link to a cached item if it exists, otherwise returns the
passed link.
"""
raise NotImp... | [
"def",
"get",
"(",
"self",
",",
"link",
",",
"# type: Link",
"package_name",
",",
"# type: Optional[str]",
"supported_tags",
",",
"# type: List[Tag]",
")",
":",
"# type: (...) -> Link",
"raise",
"NotImplementedError",
"(",
")"
] | [
161,
4
] | [
171,
35
] | python | en | ['en', 'en', 'en'] | True |
SimpleWheelCache.get_path_for_link | (self, link) | Return a directory to store cached wheels for link
Because there are M wheels for any one sdist, we provide a directory
to cache them in, and then consult that directory when looking up
cache hits.
We only insert things into the cache if they have plausible version
numbers, so ... | Return a directory to store cached wheels for link | def get_path_for_link(self, link):
# type: (Link) -> str
"""Return a directory to store cached wheels for link
Because there are M wheels for any one sdist, we provide a directory
to cache them in, and then consult that directory when looking up
cache hits.
We only inse... | [
"def",
"get_path_for_link",
"(",
"self",
",",
"link",
")",
":",
"# type: (Link) -> str",
"parts",
"=",
"self",
".",
"_get_cache_path_parts",
"(",
"link",
")",
"# Store wheels within the root cache_dir",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
... | [
189,
4
] | [
208,
61
] | python | en | ['en', 'en', 'en'] | True |
WheelCache.get_cache_entry | (
self,
link, # type: Link
package_name, # type: Optional[str]
supported_tags, # type: List[Tag]
) | Returns a CacheEntry with a link to a cached item if it exists or
None. The cache entry indicates if the item was found in the persistent
or ephemeral cache.
| Returns a CacheEntry with a link to a cached item if it exists or
None. The cache entry indicates if the item was found in the persistent
or ephemeral cache.
| def get_cache_entry(
self,
link, # type: Link
package_name, # type: Optional[str]
supported_tags, # type: List[Tag]
):
# type: (...) -> Optional[CacheEntry]
"""Returns a CacheEntry with a link to a cached item if it exists or
None. The cache ent... | [
"def",
"get_cache_entry",
"(",
"self",
",",
"link",
",",
"# type: Link",
"package_name",
",",
"# type: Optional[str]",
"supported_tags",
",",
"# type: List[Tag]",
")",
":",
"# type: (...) -> Optional[CacheEntry]",
"retval",
"=",
"self",
".",
"_wheel_cache",
".",
"get",
... | [
321,
4
] | [
348,
19
] | python | en | ['en', 'en', 'en'] | True |
get_fixed_timezone | (offset) |
Returns a tzinfo instance with a fixed offset from UTC.
|
Returns a tzinfo instance with a fixed offset from UTC.
| def get_fixed_timezone(offset):
"""
Returns a tzinfo instance with a fixed offset from UTC.
"""
if isinstance(offset, timedelta):
offset = offset.seconds // 60
sign = '-' if offset < 0 else '+'
hhmm = '%02d%02d' % divmod(abs(offset), 60)
name = sign + hhmm
return FixedOffset(offs... | [
"def",
"get_fixed_timezone",
"(",
"offset",
")",
":",
"if",
"isinstance",
"(",
"offset",
",",
"timedelta",
")",
":",
"offset",
"=",
"offset",
".",
"seconds",
"//",
"60",
"sign",
"=",
"'-'",
"if",
"offset",
"<",
"0",
"else",
"'+'",
"hhmm",
"=",
"'%02d%0... | [
153,
0
] | [
162,
36
] | python | en | ['en', 'error', 'th'] | False |
get_default_timezone | () |
Returns the default time zone as a tzinfo instance.
This is the time zone defined by settings.TIME_ZONE.
|
Returns the default time zone as a tzinfo instance. | def get_default_timezone():
"""
Returns the default time zone as a tzinfo instance.
This is the time zone defined by settings.TIME_ZONE.
"""
global _localtime
if _localtime is None:
if isinstance(settings.TIME_ZONE, six.string_types) and pytz is not None:
_localtime = pytz.t... | [
"def",
"get_default_timezone",
"(",
")",
":",
"global",
"_localtime",
"if",
"_localtime",
"is",
"None",
":",
"if",
"isinstance",
"(",
"settings",
".",
"TIME_ZONE",
",",
"six",
".",
"string_types",
")",
"and",
"pytz",
"is",
"not",
"None",
":",
"_localtime",
... | [
169,
0
] | [
182,
21
] | python | en | ['en', 'error', 'th'] | False |
get_default_timezone_name | () |
Returns the name of the default time zone.
|
Returns the name of the default time zone.
| def get_default_timezone_name():
"""
Returns the name of the default time zone.
"""
return _get_timezone_name(get_default_timezone()) | [
"def",
"get_default_timezone_name",
"(",
")",
":",
"return",
"_get_timezone_name",
"(",
"get_default_timezone",
"(",
")",
")"
] | [
186,
0
] | [
190,
53
] | python | en | ['en', 'error', 'th'] | False |
get_current_timezone | () |
Returns the currently active time zone as a tzinfo instance.
|
Returns the currently active time zone as a tzinfo instance.
| def get_current_timezone():
"""
Returns the currently active time zone as a tzinfo instance.
"""
return getattr(_active, "value", get_default_timezone()) | [
"def",
"get_current_timezone",
"(",
")",
":",
"return",
"getattr",
"(",
"_active",
",",
"\"value\"",
",",
"get_default_timezone",
"(",
")",
")"
] | [
195,
0
] | [
199,
60
] | python | en | ['en', 'error', 'th'] | False |
get_current_timezone_name | () |
Returns the name of the currently active time zone.
|
Returns the name of the currently active time zone.
| def get_current_timezone_name():
"""
Returns the name of the currently active time zone.
"""
return _get_timezone_name(get_current_timezone()) | [
"def",
"get_current_timezone_name",
"(",
")",
":",
"return",
"_get_timezone_name",
"(",
"get_current_timezone",
"(",
")",
")"
] | [
202,
0
] | [
206,
53
] | python | en | ['en', 'error', 'th'] | False |
_get_timezone_name | (timezone) |
Returns the name of ``timezone``.
|
Returns the name of ``timezone``.
| def _get_timezone_name(timezone):
"""
Returns the name of ``timezone``.
"""
try:
# for pytz timezones
return timezone.zone
except AttributeError:
# for regular tzinfo objects
return timezone.tzname(None) | [
"def",
"_get_timezone_name",
"(",
"timezone",
")",
":",
"try",
":",
"# for pytz timezones",
"return",
"timezone",
".",
"zone",
"except",
"AttributeError",
":",
"# for regular tzinfo objects",
"return",
"timezone",
".",
"tzname",
"(",
"None",
")"
] | [
209,
0
] | [
218,
36
] | python | en | ['en', 'error', 'th'] | False |
activate | (timezone) |
Sets the time zone for the current thread.
The ``timezone`` argument must be an instance of a tzinfo subclass or a
time zone name. If it is a time zone name, pytz is required.
|
Sets the time zone for the current thread. | def activate(timezone):
"""
Sets the time zone for the current thread.
The ``timezone`` argument must be an instance of a tzinfo subclass or a
time zone name. If it is a time zone name, pytz is required.
"""
if isinstance(timezone, tzinfo):
_active.value = timezone
elif isinstance(t... | [
"def",
"activate",
"(",
"timezone",
")",
":",
"if",
"isinstance",
"(",
"timezone",
",",
"tzinfo",
")",
":",
"_active",
".",
"value",
"=",
"timezone",
"elif",
"isinstance",
"(",
"timezone",
",",
"six",
".",
"string_types",
")",
"and",
"pytz",
"is",
"not",... | [
226,
0
] | [
238,
59
] | python | en | ['en', 'error', 'th'] | False |
deactivate | () |
Unsets the time zone for the current thread.
Django will then use the time zone defined by settings.TIME_ZONE.
|
Unsets the time zone for the current thread. | def deactivate():
"""
Unsets the time zone for the current thread.
Django will then use the time zone defined by settings.TIME_ZONE.
"""
if hasattr(_active, "value"):
del _active.value | [
"def",
"deactivate",
"(",
")",
":",
"if",
"hasattr",
"(",
"_active",
",",
"\"value\"",
")",
":",
"del",
"_active",
".",
"value"
] | [
241,
0
] | [
248,
25
] | python | en | ['en', 'error', 'th'] | False |
template_localtime | (value, use_tz=None) |
Checks if value is a datetime and converts it to local time if necessary.
If use_tz is provided and is not None, that will force the value to
be converted (or not), overriding the value of settings.USE_TZ.
This function is designed for use by the template engine.
|
Checks if value is a datetime and converts it to local time if necessary. | def template_localtime(value, use_tz=None):
"""
Checks if value is a datetime and converts it to local time if necessary.
If use_tz is provided and is not None, that will force the value to
be converted (or not), overriding the value of settings.USE_TZ.
This function is designed for use by the tem... | [
"def",
"template_localtime",
"(",
"value",
",",
"use_tz",
"=",
"None",
")",
":",
"should_convert",
"=",
"(",
"isinstance",
"(",
"value",
",",
"datetime",
")",
"and",
"(",
"settings",
".",
"USE_TZ",
"if",
"use_tz",
"is",
"None",
"else",
"use_tz",
")",
"an... | [
282,
0
] | [
295,
56
] | python | en | ['en', 'error', 'th'] | False |
localtime | (value, timezone=None) |
Converts an aware datetime.datetime to local time.
Local time is defined by the current time zone, unless another time zone
is specified.
|
Converts an aware datetime.datetime to local time. | def localtime(value, timezone=None):
"""
Converts an aware datetime.datetime to local time.
Local time is defined by the current time zone, unless another time zone
is specified.
"""
if timezone is None:
timezone = get_current_timezone()
# If `value` is naive, astimezone() will rais... | [
"def",
"localtime",
"(",
"value",
",",
"timezone",
"=",
"None",
")",
":",
"if",
"timezone",
"is",
"None",
":",
"timezone",
"=",
"get_current_timezone",
"(",
")",
"# If `value` is naive, astimezone() will raise a ValueError,",
"# so we don't need to perform a redundant check... | [
300,
0
] | [
315,
16
] | python | en | ['en', 'error', 'th'] | False |
now | () |
Returns an aware or naive datetime.datetime, depending on settings.USE_TZ.
|
Returns an aware or naive datetime.datetime, depending on settings.USE_TZ.
| def now():
"""
Returns an aware or naive datetime.datetime, depending on settings.USE_TZ.
"""
if settings.USE_TZ:
# timeit shows that datetime.now(tz=utc) is 24% slower
return datetime.utcnow().replace(tzinfo=utc)
else:
return datetime.now() | [
"def",
"now",
"(",
")",
":",
"if",
"settings",
".",
"USE_TZ",
":",
"# timeit shows that datetime.now(tz=utc) is 24% slower",
"return",
"datetime",
".",
"utcnow",
"(",
")",
".",
"replace",
"(",
"tzinfo",
"=",
"utc",
")",
"else",
":",
"return",
"datetime",
".",
... | [
318,
0
] | [
326,
29
] | python | en | ['en', 'error', 'th'] | False |
is_aware | (value) |
Determines if a given datetime.datetime is aware.
The logic is described in Python's docs:
http://docs.python.org/library/datetime.html#datetime.tzinfo
|
Determines if a given datetime.datetime is aware. | def is_aware(value):
"""
Determines if a given datetime.datetime is aware.
The logic is described in Python's docs:
http://docs.python.org/library/datetime.html#datetime.tzinfo
"""
return value.tzinfo is not None and value.tzinfo.utcoffset(value) is not None | [
"def",
"is_aware",
"(",
"value",
")",
":",
"return",
"value",
".",
"tzinfo",
"is",
"not",
"None",
"and",
"value",
".",
"tzinfo",
".",
"utcoffset",
"(",
"value",
")",
"is",
"not",
"None"
] | [
332,
0
] | [
339,
81
] | python | en | ['en', 'error', 'th'] | False |
is_naive | (value) |
Determines if a given datetime.datetime is naive.
The logic is described in Python's docs:
http://docs.python.org/library/datetime.html#datetime.tzinfo
|
Determines if a given datetime.datetime is naive. | def is_naive(value):
"""
Determines if a given datetime.datetime is naive.
The logic is described in Python's docs:
http://docs.python.org/library/datetime.html#datetime.tzinfo
"""
return value.tzinfo is None or value.tzinfo.utcoffset(value) is None | [
"def",
"is_naive",
"(",
"value",
")",
":",
"return",
"value",
".",
"tzinfo",
"is",
"None",
"or",
"value",
".",
"tzinfo",
".",
"utcoffset",
"(",
"value",
")",
"is",
"None"
] | [
342,
0
] | [
349,
72
] | python | en | ['en', 'error', 'th'] | False |
make_aware | (value, timezone) |
Makes a naive datetime.datetime in a given time zone aware.
|
Makes a naive datetime.datetime in a given time zone aware.
| def make_aware(value, timezone):
"""
Makes a naive datetime.datetime in a given time zone aware.
"""
if hasattr(timezone, 'localize'):
# This method is available for pytz time zones.
return timezone.localize(value, is_dst=None)
else:
# Check that we won't overwrite the timezo... | [
"def",
"make_aware",
"(",
"value",
",",
"timezone",
")",
":",
"if",
"hasattr",
"(",
"timezone",
",",
"'localize'",
")",
":",
"# This method is available for pytz time zones.",
"return",
"timezone",
".",
"localize",
"(",
"value",
",",
"is_dst",
"=",
"None",
")",
... | [
352,
0
] | [
365,
45
] | python | en | ['en', 'error', 'th'] | False |
make_naive | (value, timezone) |
Makes an aware datetime.datetime naive in a given time zone.
|
Makes an aware datetime.datetime naive in a given time zone.
| def make_naive(value, timezone):
"""
Makes an aware datetime.datetime naive in a given time zone.
"""
# If `value` is naive, astimezone() will raise a ValueError,
# so we don't need to perform a redundant check.
value = value.astimezone(timezone)
if hasattr(timezone, 'normalize'):
# ... | [
"def",
"make_naive",
"(",
"value",
",",
"timezone",
")",
":",
"# If `value` is naive, astimezone() will raise a ValueError,",
"# so we don't need to perform a redundant check.",
"value",
"=",
"value",
".",
"astimezone",
"(",
"timezone",
")",
"if",
"hasattr",
"(",
"timezone"... | [
368,
0
] | [
378,
37
] | python | en | ['en', 'error', 'th'] | False |
do_static | (parser, token) |
A template tag that returns the URL to a file
using staticfiles' storage backend
Usage::
{% static path [as varname] %}
Examples::
{% static "myapp/css/base.css" %}
{% static variable_with_path %}
{% static "myapp/css/base.css" as admin_base_css %}
{% static ... |
A template tag that returns the URL to a file
using staticfiles' storage backend | def do_static(parser, token):
"""
A template tag that returns the URL to a file
using staticfiles' storage backend
Usage::
{% static path [as varname] %}
Examples::
{% static "myapp/css/base.css" %}
{% static variable_with_path %}
{% static "myapp/css/base.css" as... | [
"def",
"do_static",
"(",
"parser",
",",
"token",
")",
":",
"return",
"StaticFilesNode",
".",
"handle_token",
"(",
"parser",
",",
"token",
")"
] | [
19,
0
] | [
36,
54
] | python | en | ['en', 'error', 'th'] | False |
AbsoluteUrlOverrideTests.test_get_absolute_url | (self) |
get_absolute_url() functions as a normal method.
|
get_absolute_url() functions as a normal method.
| def test_get_absolute_url(self):
"""
get_absolute_url() functions as a normal method.
"""
get_absolute_url = lambda o: '/test-a/%s/' % o.pk
TestA = self._create_model_class('TestA', get_absolute_url)
self.assertTrue(hasattr(TestA, 'get_absolute_url'))
obj = TestA... | [
"def",
"test_get_absolute_url",
"(",
"self",
")",
":",
"get_absolute_url",
"=",
"lambda",
"o",
":",
"'/test-a/%s/'",
"%",
"o",
".",
"pk",
"TestA",
"=",
"self",
".",
"_create_model_class",
"(",
"'TestA'",
",",
"get_absolute_url",
")",
"self",
".",
"assertTrue",... | [
6,
4
] | [
15,
72
] | python | en | ['en', 'error', 'th'] | False |
AbsoluteUrlOverrideTests.test_override_get_absolute_url | (self) |
ABSOLUTE_URL_OVERRIDES should override get_absolute_url().
|
ABSOLUTE_URL_OVERRIDES should override get_absolute_url().
| def test_override_get_absolute_url(self):
"""
ABSOLUTE_URL_OVERRIDES should override get_absolute_url().
"""
get_absolute_url = lambda o: '/test-b/%s/' % o.pk
with self.settings(
ABSOLUTE_URL_OVERRIDES={
'absolute_url_overrides.testb': lambda o: '/over... | [
"def",
"test_override_get_absolute_url",
"(",
"self",
")",
":",
"get_absolute_url",
"=",
"lambda",
"o",
":",
"'/test-b/%s/'",
"%",
"o",
".",
"pk",
"with",
"self",
".",
"settings",
"(",
"ABSOLUTE_URL_OVERRIDES",
"=",
"{",
"'absolute_url_overrides.testb'",
":",
"lam... | [
17,
4
] | [
29,
87
] | python | en | ['en', 'error', 'th'] | False |
AbsoluteUrlOverrideTests.test_insert_get_absolute_url | (self) |
ABSOLUTE_URL_OVERRIDES should work even if the model doesn't have a
get_absolute_url() method.
|
ABSOLUTE_URL_OVERRIDES should work even if the model doesn't have a
get_absolute_url() method.
| def test_insert_get_absolute_url(self):
"""
ABSOLUTE_URL_OVERRIDES should work even if the model doesn't have a
get_absolute_url() method.
"""
with self.settings(
ABSOLUTE_URL_OVERRIDES={
'absolute_url_overrides.testc': lambda o: '/test-c/%s/' % o.pk,
... | [
"def",
"test_insert_get_absolute_url",
"(",
"self",
")",
":",
"with",
"self",
".",
"settings",
"(",
"ABSOLUTE_URL_OVERRIDES",
"=",
"{",
"'absolute_url_overrides.testc'",
":",
"lambda",
"o",
":",
"'/test-c/%s/'",
"%",
"o",
".",
"pk",
",",
"}",
",",
")",
":",
... | [
31,
4
] | [
43,
76
] | python | en | ['en', 'error', 'th'] | False |
open | (filename) |
Load texture from a Quake2 WAL texture file.
By default, a Quake2 standard palette is attached to the texture.
To override the palette, use the :py:func:`PIL.Image.Image.putpalette()` method.
:param filename: WAL file name, or an opened file handle.
:returns: An image instance.
|
Load texture from a Quake2 WAL texture file. | def open(filename):
"""
Load texture from a Quake2 WAL texture file.
By default, a Quake2 standard palette is attached to the texture.
To override the palette, use the :py:func:`PIL.Image.Image.putpalette()` method.
:param filename: WAL file name, or an opened file handle.
:returns: An image i... | [
"def",
"open",
"(",
"filename",
")",
":",
"# FIXME: modify to return a WalImageFile instance instead of",
"# plain Image object ?",
"def",
"imopen",
"(",
"fp",
")",
":",
"# read header fields",
"header",
"=",
"fp",
".",
"read",
"(",
"32",
"+",
"24",
"+",
"32",
"+"... | [
31,
0
] | [
72,
29
] | python | en | ['en', 'error', 'th'] | False |
TestClientModel.test_client_stringification | (self) |
This test is designed to cover __str__ method for Client.
|
This test is designed to cover __str__ method for Client.
| def test_client_stringification(self) -> None:
"""
This test is designed to cover __str__ method for Client.
"""
client = make_client("some_client")
self.assertEqual(str(client), "<Client: some_client>") | [
"def",
"test_client_stringification",
"(",
"self",
")",
"->",
"None",
":",
"client",
"=",
"make_client",
"(",
"\"some_client\"",
")",
"self",
".",
"assertEqual",
"(",
"str",
"(",
"client",
")",
",",
"\"<Client: some_client>\"",
")"
] | [
72,
4
] | [
77,
62
] | python | en | ['en', 'error', 'th'] | False |
UserPresenceTests.test_new_user_input | (self, unused_mock: mock.Mock) | Mostly a test for UserActivityInterval | Mostly a test for UserActivityInterval | def test_new_user_input(self, unused_mock: mock.Mock) -> None:
"""Mostly a test for UserActivityInterval"""
user_profile = self.example_user("hamlet")
self.login("hamlet")
self.assertEqual(UserActivityInterval.objects.filter(user_profile=user_profile).count(), 0)
time_zero = time... | [
"def",
"test_new_user_input",
"(",
"self",
",",
"unused_mock",
":",
"mock",
".",
"Mock",
")",
"->",
"None",
":",
"user_profile",
"=",
"self",
".",
"example_user",
"(",
"\"hamlet\"",
")",
"self",
".",
"login",
"(",
"\"hamlet\"",
")",
"self",
".",
"assertEqu... | [
252,
4
] | [
340,
49
] | python | en | ['en', 'en', 'en'] | True |
UserPresenceTests.test_no_mit | (self) | Zephyr mirror realms such as MIT never get a list of users | Zephyr mirror realms such as MIT never get a list of users | def test_no_mit(self) -> None:
"""Zephyr mirror realms such as MIT never get a list of users"""
user = self.mit_user("espuser")
self.login_user(user)
result = self.client_post("/json/users/me/presence", {"status": "idle"}, subdomain="zephyr")
self.assert_json_success(result)
... | [
"def",
"test_no_mit",
"(",
"self",
")",
"->",
"None",
":",
"user",
"=",
"self",
".",
"mit_user",
"(",
"\"espuser\"",
")",
"self",
".",
"login_user",
"(",
"user",
")",
"result",
"=",
"self",
".",
"client_post",
"(",
"\"/json/users/me/presence\"",
",",
"{",
... | [
361,
4
] | [
367,
56
] | python | en | ['en', 'en', 'en'] | True |
UserPresenceTests.test_mirror_presence | (self) | Zephyr mirror realms find out the status of their mirror bot | Zephyr mirror realms find out the status of their mirror bot | def test_mirror_presence(self) -> None:
"""Zephyr mirror realms find out the status of their mirror bot"""
user_profile = self.mit_user("espuser")
self.login_user(user_profile)
def post_presence() -> Dict[str, Any]:
result = self.client_post(
"/json/users/me/... | [
"def",
"test_mirror_presence",
"(",
"self",
")",
"->",
"None",
":",
"user_profile",
"=",
"self",
".",
"mit_user",
"(",
"\"espuser\"",
")",
"self",
".",
"login_user",
"(",
"user_profile",
")",
"def",
"post_presence",
"(",
")",
"->",
"Dict",
"[",
"str",
",",... | [
369,
4
] | [
387,
60
] | python | en | ['en', 'en', 'en'] | True |
sort_dependencies | (app_list) | Sort a list of (app_config, models) pairs into a single list of models.
The single list of models is sorted so that any model with a natural key
is serialized before a normal model, and any model with a natural key
dependency has it's dependencies serialized first.
| Sort a list of (app_config, models) pairs into a single list of models. | def sort_dependencies(app_list):
"""Sort a list of (app_config, models) pairs into a single list of models.
The single list of models is sorted so that any model with a natural key
is serialized before a normal model, and any model with a natural key
dependency has it's dependencies serialized first.
... | [
"def",
"sort_dependencies",
"(",
"app_list",
")",
":",
"# Process the list of models, and get the list of dependencies",
"model_dependencies",
"=",
"[",
"]",
"models",
"=",
"set",
"(",
")",
"for",
"app_config",
",",
"model_list",
"in",
"app_list",
":",
"if",
"model_li... | [
172,
0
] | [
248,
21
] | python | en | ['en', 'en', 'en'] | True |
AdminScriptTestCase._ext_backend_paths | (self) |
Returns the paths for any external backend packages.
|
Returns the paths for any external backend packages.
| def _ext_backend_paths(self):
"""
Returns the paths for any external backend packages.
"""
paths = []
first_package_re = re.compile(r'(^[^\.]+)\.')
for backend in settings.DATABASES.values():
result = first_package_re.findall(backend['ENGINE'])
if ... | [
"def",
"_ext_backend_paths",
"(",
"self",
")",
":",
"paths",
"=",
"[",
"]",
"first_package_re",
"=",
"re",
".",
"compile",
"(",
"r'(^[^\\.]+)\\.'",
")",
"for",
"backend",
"in",
"settings",
".",
"DATABASES",
".",
"values",
"(",
")",
":",
"result",
"=",
"f... | [
100,
4
] | [
112,
20
] | python | en | ['en', 'error', 'th'] | False |
AdminScriptTestCase.assertNoOutput | (self, stream) | Utility assertion: assert that the given stream is empty | Utility assertion: assert that the given stream is empty | def assertNoOutput(self, stream):
"Utility assertion: assert that the given stream is empty"
self.assertEqual(len(stream), 0, "Stream should be empty: actually contains '%s'" % stream) | [
"def",
"assertNoOutput",
"(",
"self",
",",
"stream",
")",
":",
"self",
".",
"assertEqual",
"(",
"len",
"(",
"stream",
")",
",",
"0",
",",
"\"Stream should be empty: actually contains '%s'\"",
"%",
"stream",
")"
] | [
181,
4
] | [
183,
99
] | python | en | ['en', 'en', 'en'] | True |
AdminScriptTestCase.assertOutput | (self, stream, msg, regex=False) | Utility assertion: assert that the given message exists in the output | Utility assertion: assert that the given message exists in the output | def assertOutput(self, stream, msg, regex=False):
"Utility assertion: assert that the given message exists in the output"
stream = force_text(stream)
if regex:
self.assertIsNotNone(re.search(msg, stream),
"'%s' does not match actual output text '%s'" % (msg, stream))
... | [
"def",
"assertOutput",
"(",
"self",
",",
"stream",
",",
"msg",
",",
"regex",
"=",
"False",
")",
":",
"stream",
"=",
"force_text",
"(",
"stream",
")",
"if",
"regex",
":",
"self",
".",
"assertIsNotNone",
"(",
"re",
".",
"search",
"(",
"msg",
",",
"stre... | [
185,
4
] | [
192,
105
] | python | en | ['en', 'en', 'en'] | True |
AdminScriptTestCase.assertNotInOutput | (self, stream, msg) | Utility assertion: assert that the given message doesn't exist in the output | Utility assertion: assert that the given message doesn't exist in the output | def assertNotInOutput(self, stream, msg):
"Utility assertion: assert that the given message doesn't exist in the output"
stream = force_text(stream)
self.assertFalse(msg in stream, "'%s' matches actual output text '%s'" % (msg, stream)) | [
"def",
"assertNotInOutput",
"(",
"self",
",",
"stream",
",",
"msg",
")",
":",
"stream",
"=",
"force_text",
"(",
"stream",
")",
"self",
".",
"assertFalse",
"(",
"msg",
"in",
"stream",
",",
"\"'%s' matches actual output text '%s'\"",
"%",
"(",
"msg",
",",
"str... | [
194,
4
] | [
197,
95
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminNoSettings.test_builtin_command | (self) | no settings: django-admin builtin commands fail with an error when no settings provided | no settings: django-admin builtin commands fail with an error when no settings provided | def test_builtin_command(self):
"no settings: django-admin builtin commands fail with an error when no settings provided"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput(err, 'settings are not configured') | [
"def",
"test_builtin_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"asse... | [
209,
4
] | [
214,
61
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminNoSettings.test_builtin_with_bad_settings | (self) | no settings: django-admin builtin commands fail if settings file (from argument) doesn't exist | no settings: django-admin builtin commands fail if settings file (from argument) doesn't exist | def test_builtin_with_bad_settings(self):
"no settings: django-admin builtin commands fail if settings file (from argument) doesn't exist"
args = ['sqlall', '--settings=bad_settings', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutp... | [
"def",
"test_builtin_with_bad_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=bad_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",... | [
216,
4
] | [
221,
78
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminNoSettings.test_builtin_with_bad_environment | (self) | no settings: django-admin builtin commands fail if settings file (from environment) doesn't exist | no settings: django-admin builtin commands fail if settings file (from environment) doesn't exist | def test_builtin_with_bad_environment(self):
"no settings: django-admin builtin commands fail if settings file (from environment) doesn't exist"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args, 'bad_settings')
self.assertNoOutput(out)
self.assertOutput(er... | [
"def",
"test_builtin_with_bad_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'bad_settings'",
")",
"self",
".",
"assertNoOutput",
"(",
... | [
223,
4
] | [
228,
78
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminDefaultSettings.test_builtin_command | (self) | default: django-admin builtin commands fail with an error when no settings provided | default: django-admin builtin commands fail with an error when no settings provided | def test_builtin_command(self):
"default: django-admin builtin commands fail with an error when no settings provided"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput(err, 'settings are not configured') | [
"def",
"test_builtin_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"asse... | [
241,
4
] | [
246,
61
] | python | en | ['en', 'lb', 'en'] | True |
DjangoAdminDefaultSettings.test_builtin_with_settings | (self) | default: django-admin builtin commands succeed if settings are provided as argument | default: django-admin builtin commands succeed if settings are provided as argument | def test_builtin_with_settings(self):
"default: django-admin builtin commands succeed if settings are provided as argument"
args = ['sqlall', '--settings=test_project.settings', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(err)
self.assertOutput(out... | [
"def",
"test_builtin_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=test_project.settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOut... | [
248,
4
] | [
253,
46
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminDefaultSettings.test_builtin_with_environment | (self) | default: django-admin builtin commands succeed if settings are provided in the environment | default: django-admin builtin commands succeed if settings are provided in the environment | def test_builtin_with_environment(self):
"default: django-admin builtin commands succeed if settings are provided in the environment"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args, 'test_project.settings')
self.assertNoOutput(err)
self.assertOutput(out,... | [
"def",
"test_builtin_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'test_project.settings'",
")",
"self",
".",
"assertNoOutput",
... | [
255,
4
] | [
260,
46
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminDefaultSettings.test_builtin_with_bad_settings | (self) | default: django-admin builtin commands fail if settings file (from argument) doesn't exist | default: django-admin builtin commands fail if settings file (from argument) doesn't exist | def test_builtin_with_bad_settings(self):
"default: django-admin builtin commands fail if settings file (from argument) doesn't exist"
args = ['sqlall', '--settings=bad_settings', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput(e... | [
"def",
"test_builtin_with_bad_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=bad_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",... | [
262,
4
] | [
267,
78
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminDefaultSettings.test_builtin_with_bad_environment | (self) | default: django-admin builtin commands fail if settings file (from environment) doesn't exist | default: django-admin builtin commands fail if settings file (from environment) doesn't exist | def test_builtin_with_bad_environment(self):
"default: django-admin builtin commands fail if settings file (from environment) doesn't exist"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args, 'bad_settings')
self.assertNoOutput(out)
self.assertOutput(err, "... | [
"def",
"test_builtin_with_bad_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'bad_settings'",
")",
"self",
".",
"assertNoOutput",
"(",
... | [
269,
4
] | [
274,
78
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminDefaultSettings.test_custom_command | (self) | default: django-admin can't execute user commands if it isn't provided settings | default: django-admin can't execute user commands if it isn't provided settings | def test_custom_command(self):
"default: django-admin can't execute user commands if it isn't provided settings"
args = ['noargs_command']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput(err, "settings are not configured") | [
"def",
"test_custom_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"assertOutput",
"(",
"... | [
276,
4
] | [
281,
61
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminDefaultSettings.test_custom_command_with_settings | (self) | default: django-admin can execute user commands if settings are provided as argument | default: django-admin can execute user commands if settings are provided as argument | def test_custom_command_with_settings(self):
"default: django-admin can execute user commands if settings are provided as argument"
args = ['noargs_command', '--settings=test_project.settings']
out, err = self.run_django_admin(args)
self.assertNoOutput(err)
self.assertOutput(out,... | [
"def",
"test_custom_command_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
",",
"'--settings=test_project.settings'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
... | [
283,
4
] | [
288,
57
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminDefaultSettings.test_custom_command_with_environment | (self) | default: django-admin can execute user commands if settings are provided in environment | default: django-admin can execute user commands if settings are provided in environment | def test_custom_command_with_environment(self):
"default: django-admin can execute user commands if settings are provided in environment"
args = ['noargs_command']
out, err = self.run_django_admin(args, 'test_project.settings')
self.assertNoOutput(err)
self.assertOutput(out, "EXE... | [
"def",
"test_custom_command_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'test_project.settings'",
")",
"self",
".",
"assertNoOutput",
"(",
"err",... | [
290,
4
] | [
295,
57
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminFullPathDefaultSettings.test_builtin_command | (self) | fulldefault: django-admin builtin commands fail with an error when no settings provided | fulldefault: django-admin builtin commands fail with an error when no settings provided | def test_builtin_command(self):
"fulldefault: django-admin builtin commands fail with an error when no settings provided"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput(err, 'settings are not configured') | [
"def",
"test_builtin_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"asse... | [
309,
4
] | [
314,
61
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminFullPathDefaultSettings.test_builtin_with_settings | (self) | fulldefault: django-admin builtin commands succeed if a settings file is provided | fulldefault: django-admin builtin commands succeed if a settings file is provided | def test_builtin_with_settings(self):
"fulldefault: django-admin builtin commands succeed if a settings file is provided"
args = ['sqlall', '--settings=test_project.settings', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(err)
self.assertOutput(out, ... | [
"def",
"test_builtin_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=test_project.settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOut... | [
316,
4
] | [
321,
46
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminFullPathDefaultSettings.test_sqlclear_builtin_with_settings | (self) | fulldefault: django-admin builtin commands succeed if a setting file is provided | fulldefault: django-admin builtin commands succeed if a setting file is provided | def test_sqlclear_builtin_with_settings(self):
"fulldefault: django-admin builtin commands succeed if a setting file is provided"
args = ['sqlclear', '--settings=test_project.settings', 'complex_app']
out, err = self.run_django_admin(args)
self.assertNoOutput(err)
self.assertOutp... | [
"def",
"test_sqlclear_builtin_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlclear'",
",",
"'--settings=test_project.settings'",
",",
"'complex_app'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"as... | [
323,
4
] | [
328,
90
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminFullPathDefaultSettings.test_builtin_with_environment | (self) | fulldefault: django-admin builtin commands succeed if the environment contains settings | fulldefault: django-admin builtin commands succeed if the environment contains settings | def test_builtin_with_environment(self):
"fulldefault: django-admin builtin commands succeed if the environment contains settings"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args, 'test_project.settings')
self.assertNoOutput(err)
self.assertOutput(out, 'C... | [
"def",
"test_builtin_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'test_project.settings'",
")",
"self",
".",
"assertNoOutput",
... | [
330,
4
] | [
335,
46
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminFullPathDefaultSettings.test_builtin_with_bad_settings | (self) | fulldefault: django-admin builtin commands fail if settings file (from argument) doesn't exist | fulldefault: django-admin builtin commands fail if settings file (from argument) doesn't exist | def test_builtin_with_bad_settings(self):
"fulldefault: django-admin builtin commands fail if settings file (from argument) doesn't exist"
args = ['sqlall', '--settings=bad_settings', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutp... | [
"def",
"test_builtin_with_bad_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=bad_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",... | [
337,
4
] | [
342,
78
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminFullPathDefaultSettings.test_builtin_with_bad_environment | (self) | fulldefault: django-admin builtin commands fail if settings file (from environment) doesn't exist | fulldefault: django-admin builtin commands fail if settings file (from environment) doesn't exist | def test_builtin_with_bad_environment(self):
"fulldefault: django-admin builtin commands fail if settings file (from environment) doesn't exist"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args, 'bad_settings')
self.assertNoOutput(out)
self.assertOutput(er... | [
"def",
"test_builtin_with_bad_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'bad_settings'",
")",
"self",
".",
"assertNoOutput",
"(",
... | [
344,
4
] | [
349,
78
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminFullPathDefaultSettings.test_custom_command | (self) | fulldefault: django-admin can't execute user commands unless settings are provided | fulldefault: django-admin can't execute user commands unless settings are provided | def test_custom_command(self):
"fulldefault: django-admin can't execute user commands unless settings are provided"
args = ['noargs_command']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput(err, "settings are not configured") | [
"def",
"test_custom_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"assertOutput",
"(",
"... | [
351,
4
] | [
356,
61
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminFullPathDefaultSettings.test_custom_command_with_settings | (self) | fulldefault: django-admin can execute user commands if settings are provided as argument | fulldefault: django-admin can execute user commands if settings are provided as argument | def test_custom_command_with_settings(self):
"fulldefault: django-admin can execute user commands if settings are provided as argument"
args = ['noargs_command', '--settings=test_project.settings']
out, err = self.run_django_admin(args)
self.assertNoOutput(err)
self.assertOutput(... | [
"def",
"test_custom_command_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
",",
"'--settings=test_project.settings'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
... | [
358,
4
] | [
363,
57
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminFullPathDefaultSettings.test_custom_command_with_environment | (self) | fulldefault: django-admin can execute user commands if settings are provided in environment | fulldefault: django-admin can execute user commands if settings are provided in environment | def test_custom_command_with_environment(self):
"fulldefault: django-admin can execute user commands if settings are provided in environment"
args = ['noargs_command']
out, err = self.run_django_admin(args, 'test_project.settings')
self.assertNoOutput(err)
self.assertOutput(out, ... | [
"def",
"test_custom_command_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'test_project.settings'",
")",
"self",
".",
"assertNoOutput",
"(",
"err",... | [
365,
4
] | [
370,
57
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminMinimalSettings.test_builtin_command | (self) | minimal: django-admin builtin commands fail with an error when no settings provided | minimal: django-admin builtin commands fail with an error when no settings provided | def test_builtin_command(self):
"minimal: django-admin builtin commands fail with an error when no settings provided"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput(err, 'settings are not configured') | [
"def",
"test_builtin_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"asse... | [
383,
4
] | [
388,
61
] | python | en | ['en', 'gd', 'en'] | True |
DjangoAdminMinimalSettings.test_builtin_with_settings | (self) | minimal: django-admin builtin commands fail if settings are provided as argument | minimal: django-admin builtin commands fail if settings are provided as argument | def test_builtin_with_settings(self):
"minimal: django-admin builtin commands fail if settings are provided as argument"
args = ['sqlall', '--settings=test_project.settings', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput(err, "... | [
"def",
"test_builtin_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=test_project.settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOut... | [
390,
4
] | [
395,
78
] | python | en | ['en', 'ms', 'en'] | True |
DjangoAdminMinimalSettings.test_builtin_with_environment | (self) | minimal: django-admin builtin commands fail if settings are provided in the environment | minimal: django-admin builtin commands fail if settings are provided in the environment | def test_builtin_with_environment(self):
"minimal: django-admin builtin commands fail if settings are provided in the environment"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args, 'test_project.settings')
self.assertNoOutput(out)
self.assertOutput(err, "N... | [
"def",
"test_builtin_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'test_project.settings'",
")",
"self",
".",
"assertNoOutput",
... | [
397,
4
] | [
402,
78
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminMinimalSettings.test_builtin_with_bad_settings | (self) | minimal: django-admin builtin commands fail if settings file (from argument) doesn't exist | minimal: django-admin builtin commands fail if settings file (from argument) doesn't exist | def test_builtin_with_bad_settings(self):
"minimal: django-admin builtin commands fail if settings file (from argument) doesn't exist"
args = ['sqlall', '--settings=bad_settings', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput(e... | [
"def",
"test_builtin_with_bad_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=bad_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",... | [
404,
4
] | [
409,
78
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminMinimalSettings.test_builtin_with_bad_environment | (self) | minimal: django-admin builtin commands fail if settings file (from environment) doesn't exist | minimal: django-admin builtin commands fail if settings file (from environment) doesn't exist | def test_builtin_with_bad_environment(self):
"minimal: django-admin builtin commands fail if settings file (from environment) doesn't exist"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args, 'bad_settings')
self.assertNoOutput(out)
self.assertOutput(err, "... | [
"def",
"test_builtin_with_bad_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'bad_settings'",
")",
"self",
".",
"assertNoOutput",
"(",
... | [
411,
4
] | [
416,
78
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminMinimalSettings.test_custom_command | (self) | minimal: django-admin can't execute user commands unless settings are provided | minimal: django-admin can't execute user commands unless settings are provided | def test_custom_command(self):
"minimal: django-admin can't execute user commands unless settings are provided"
args = ['noargs_command']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput(err, "settings are not configured") | [
"def",
"test_custom_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"assertOutput",
"(",
"... | [
418,
4
] | [
423,
61
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminMinimalSettings.test_custom_command_with_settings | (self) | minimal: django-admin can't execute user commands, even if settings are provided as argument | minimal: django-admin can't execute user commands, even if settings are provided as argument | def test_custom_command_with_settings(self):
"minimal: django-admin can't execute user commands, even if settings are provided as argument"
args = ['noargs_command', '--settings=test_project.settings']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOut... | [
"def",
"test_custom_command_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
",",
"'--settings=test_project.settings'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
... | [
425,
4
] | [
430,
67
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminMinimalSettings.test_custom_command_with_environment | (self) | minimal: django-admin can't execute user commands, even if settings are provided in environment | minimal: django-admin can't execute user commands, even if settings are provided in environment | def test_custom_command_with_environment(self):
"minimal: django-admin can't execute user commands, even if settings are provided in environment"
args = ['noargs_command']
out, err = self.run_django_admin(args, 'test_project.settings')
self.assertNoOutput(out)
self.assertOutput(e... | [
"def",
"test_custom_command_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'test_project.settings'",
")",
"self",
".",
"assertNoOutput",
"(",
"out",... | [
432,
4
] | [
437,
67
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminAlternateSettings.test_builtin_command | (self) | alternate: django-admin builtin commands fail with an error when no settings provided | alternate: django-admin builtin commands fail with an error when no settings provided | def test_builtin_command(self):
"alternate: django-admin builtin commands fail with an error when no settings provided"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput(err, 'settings are not configured') | [
"def",
"test_builtin_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"asse... | [
450,
4
] | [
455,
61
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminAlternateSettings.test_builtin_with_settings | (self) | alternate: django-admin builtin commands succeed if settings are provided as argument | alternate: django-admin builtin commands succeed if settings are provided as argument | def test_builtin_with_settings(self):
"alternate: django-admin builtin commands succeed if settings are provided as argument"
args = ['sqlall', '--settings=test_project.alternate_settings', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(err)
self.asse... | [
"def",
"test_builtin_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=test_project.alternate_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"a... | [
457,
4
] | [
462,
46
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminAlternateSettings.test_builtin_with_environment | (self) | alternate: django-admin builtin commands succeed if settings are provided in the environment | alternate: django-admin builtin commands succeed if settings are provided in the environment | def test_builtin_with_environment(self):
"alternate: django-admin builtin commands succeed if settings are provided in the environment"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args, 'test_project.alternate_settings')
self.assertNoOutput(err)
self.asser... | [
"def",
"test_builtin_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'test_project.alternate_settings'",
")",
"self",
".",
"assertNoO... | [
464,
4
] | [
469,
46
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminAlternateSettings.test_builtin_with_bad_settings | (self) | alternate: django-admin builtin commands fail if settings file (from argument) doesn't exist | alternate: django-admin builtin commands fail if settings file (from argument) doesn't exist | def test_builtin_with_bad_settings(self):
"alternate: django-admin builtin commands fail if settings file (from argument) doesn't exist"
args = ['sqlall', '--settings=bad_settings', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput... | [
"def",
"test_builtin_with_bad_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=bad_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",... | [
471,
4
] | [
476,
78
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminAlternateSettings.test_builtin_with_bad_environment | (self) | alternate: django-admin builtin commands fail if settings file (from environment) doesn't exist | alternate: django-admin builtin commands fail if settings file (from environment) doesn't exist | def test_builtin_with_bad_environment(self):
"alternate: django-admin builtin commands fail if settings file (from environment) doesn't exist"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args, 'bad_settings')
self.assertNoOutput(out)
self.assertOutput(err,... | [
"def",
"test_builtin_with_bad_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'bad_settings'",
")",
"self",
".",
"assertNoOutput",
"(",
... | [
478,
4
] | [
483,
78
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminAlternateSettings.test_custom_command | (self) | alternate: django-admin can't execute user commands unless settings are provided | alternate: django-admin can't execute user commands unless settings are provided | def test_custom_command(self):
"alternate: django-admin can't execute user commands unless settings are provided"
args = ['noargs_command']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput(err, "settings are not configured") | [
"def",
"test_custom_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"assertOutput",
"(",
"... | [
485,
4
] | [
490,
61
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminAlternateSettings.test_custom_command_with_settings | (self) | alternate: django-admin can execute user commands if settings are provided as argument | alternate: django-admin can execute user commands if settings are provided as argument | def test_custom_command_with_settings(self):
"alternate: django-admin can execute user commands if settings are provided as argument"
args = ['noargs_command', '--settings=test_project.alternate_settings']
out, err = self.run_django_admin(args)
self.assertNoOutput(err)
self.asser... | [
"def",
"test_custom_command_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
",",
"'--settings=test_project.alternate_settings'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput... | [
492,
4
] | [
497,
57
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminAlternateSettings.test_custom_command_with_environment | (self) | alternate: django-admin can execute user commands if settings are provided in environment | alternate: django-admin can execute user commands if settings are provided in environment | def test_custom_command_with_environment(self):
"alternate: django-admin can execute user commands if settings are provided in environment"
args = ['noargs_command']
out, err = self.run_django_admin(args, 'test_project.alternate_settings')
self.assertNoOutput(err)
self.assertOutp... | [
"def",
"test_custom_command_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'test_project.alternate_settings'",
")",
"self",
".",
"assertNoOutput",
"("... | [
499,
4
] | [
504,
57
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminMultipleSettings.test_builtin_command | (self) | alternate: django-admin builtin commands fail with an error when no settings provided | alternate: django-admin builtin commands fail with an error when no settings provided | def test_builtin_command(self):
"alternate: django-admin builtin commands fail with an error when no settings provided"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput(err, 'settings are not configured') | [
"def",
"test_builtin_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"asse... | [
521,
4
] | [
526,
61
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminMultipleSettings.test_builtin_with_settings | (self) | alternate: django-admin builtin commands succeed if settings are provided as argument | alternate: django-admin builtin commands succeed if settings are provided as argument | def test_builtin_with_settings(self):
"alternate: django-admin builtin commands succeed if settings are provided as argument"
args = ['sqlall', '--settings=test_project.alternate_settings', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(err)
self.asse... | [
"def",
"test_builtin_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=test_project.alternate_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"a... | [
528,
4
] | [
533,
46
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminMultipleSettings.test_builtin_with_environment | (self) | alternate: django-admin builtin commands succeed if settings are provided in the environment | alternate: django-admin builtin commands succeed if settings are provided in the environment | def test_builtin_with_environment(self):
"alternate: django-admin builtin commands succeed if settings are provided in the environment"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args, 'test_project.alternate_settings')
self.assertNoOutput(err)
self.asser... | [
"def",
"test_builtin_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'test_project.alternate_settings'",
")",
"self",
".",
"assertNoO... | [
535,
4
] | [
540,
46
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminMultipleSettings.test_builtin_with_bad_settings | (self) | alternate: django-admin builtin commands fail if settings file (from argument) doesn't exist | alternate: django-admin builtin commands fail if settings file (from argument) doesn't exist | def test_builtin_with_bad_settings(self):
"alternate: django-admin builtin commands fail if settings file (from argument) doesn't exist"
args = ['sqlall', '--settings=bad_settings', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertOutput(err, "No module named '?bad_sett... | [
"def",
"test_builtin_with_bad_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=bad_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertOutput",
... | [
542,
4
] | [
546,
78
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminMultipleSettings.test_builtin_with_bad_environment | (self) | alternate: django-admin builtin commands fail if settings file (from environment) doesn't exist | alternate: django-admin builtin commands fail if settings file (from environment) doesn't exist | def test_builtin_with_bad_environment(self):
"alternate: django-admin builtin commands fail if settings file (from environment) doesn't exist"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args, 'bad_settings')
self.assertNoOutput(out)
self.assertOutput(err,... | [
"def",
"test_builtin_with_bad_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'bad_settings'",
")",
"self",
".",
"assertNoOutput",
"(",
... | [
548,
4
] | [
553,
78
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminMultipleSettings.test_custom_command | (self) | alternate: django-admin can't execute user commands unless settings are provided | alternate: django-admin can't execute user commands unless settings are provided | def test_custom_command(self):
"alternate: django-admin can't execute user commands unless settings are provided"
args = ['noargs_command']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput(err, "settings are not configured") | [
"def",
"test_custom_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"assertOutput",
"(",
"... | [
555,
4
] | [
560,
61
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminMultipleSettings.test_custom_command_with_settings | (self) | alternate: django-admin can execute user commands if settings are provided as argument | alternate: django-admin can execute user commands if settings are provided as argument | def test_custom_command_with_settings(self):
"alternate: django-admin can execute user commands if settings are provided as argument"
args = ['noargs_command', '--settings=test_project.alternate_settings']
out, err = self.run_django_admin(args)
self.assertNoOutput(err)
self.asser... | [
"def",
"test_custom_command_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
",",
"'--settings=test_project.alternate_settings'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput... | [
562,
4
] | [
567,
57
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminMultipleSettings.test_custom_command_with_environment | (self) | alternate: django-admin can execute user commands if settings are provided in environment | alternate: django-admin can execute user commands if settings are provided in environment | def test_custom_command_with_environment(self):
"alternate: django-admin can execute user commands if settings are provided in environment"
args = ['noargs_command']
out, err = self.run_django_admin(args, 'test_project.alternate_settings')
self.assertNoOutput(err)
self.assertOutp... | [
"def",
"test_custom_command_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'test_project.alternate_settings'",
")",
"self",
".",
"assertNoOutput",
"("... | [
569,
4
] | [
574,
57
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminSettingsDirectory.test_setup_environ | (self) | directory: startapp creates the correct directory | directory: startapp creates the correct directory | def test_setup_environ(self):
"directory: startapp creates the correct directory"
args = ['startapp', 'settings_test']
app_path = os.path.join(test_dir, 'settings_test')
out, err = self.run_django_admin(args, 'test_project.settings')
self.addCleanup(shutil.rmtree, app_path)
... | [
"def",
"test_setup_environ",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'startapp'",
",",
"'settings_test'",
"]",
"app_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"test_dir",
",",
"'settings_test'",
")",
"out",
",",
"err",
"=",
"self",
".",
"run_djan... | [
589,
4
] | [
596,
49
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminSettingsDirectory.test_setup_environ_custom_template | (self) | directory: startapp creates the correct directory with a custom template | directory: startapp creates the correct directory with a custom template | def test_setup_environ_custom_template(self):
"directory: startapp creates the correct directory with a custom template"
template_path = os.path.join(custom_templates_dir, 'app_template')
args = ['startapp', '--template', template_path, 'custom_settings_test']
app_path = os.path.join(tes... | [
"def",
"test_setup_environ_custom_template",
"(",
"self",
")",
":",
"template_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"custom_templates_dir",
",",
"'app_template'",
")",
"args",
"=",
"[",
"'startapp'",
",",
"'--template'",
",",
"template_path",
",",
"'c... | [
598,
4
] | [
607,
73
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminSettingsDirectory.test_builtin_command | (self) | directory: django-admin builtin commands fail with an error when no settings provided | directory: django-admin builtin commands fail with an error when no settings provided | def test_builtin_command(self):
"directory: django-admin builtin commands fail with an error when no settings provided"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput(err, 'settings are not configured') | [
"def",
"test_builtin_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"asse... | [
609,
4
] | [
614,
61
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminSettingsDirectory.test_builtin_with_bad_settings | (self) | directory: django-admin builtin commands fail if settings file (from argument) doesn't exist | directory: django-admin builtin commands fail if settings file (from argument) doesn't exist | def test_builtin_with_bad_settings(self):
"directory: django-admin builtin commands fail if settings file (from argument) doesn't exist"
args = ['sqlall', '--settings=bad_settings', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertOutput(err, "No module named '?bad_sett... | [
"def",
"test_builtin_with_bad_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=bad_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertOutput",
... | [
616,
4
] | [
620,
78
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminSettingsDirectory.test_builtin_with_bad_environment | (self) | directory: django-admin builtin commands fail if settings file (from environment) doesn't exist | directory: django-admin builtin commands fail if settings file (from environment) doesn't exist | def test_builtin_with_bad_environment(self):
"directory: django-admin builtin commands fail if settings file (from environment) doesn't exist"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args, 'bad_settings')
self.assertNoOutput(out)
self.assertOutput(err,... | [
"def",
"test_builtin_with_bad_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'bad_settings'",
")",
"self",
".",
"assertNoOutput",
"(",
... | [
622,
4
] | [
627,
78
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminSettingsDirectory.test_custom_command | (self) | directory: django-admin can't execute user commands unless settings are provided | directory: django-admin can't execute user commands unless settings are provided | def test_custom_command(self):
"directory: django-admin can't execute user commands unless settings are provided"
args = ['noargs_command']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
self.assertOutput(err, "settings are not configured") | [
"def",
"test_custom_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"assertOutput",
"(",
"... | [
629,
4
] | [
634,
61
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminSettingsDirectory.test_builtin_with_settings | (self) | directory: django-admin builtin commands succeed if settings are provided as argument | directory: django-admin builtin commands succeed if settings are provided as argument | def test_builtin_with_settings(self):
"directory: django-admin builtin commands succeed if settings are provided as argument"
args = ['sqlall', '--settings=test_project.settings', 'admin_scripts']
out, err = self.run_django_admin(args)
self.assertNoOutput(err)
self.assertOutput(o... | [
"def",
"test_builtin_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=test_project.settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
")",
"self",
".",
"assertNoOut... | [
636,
4
] | [
641,
46
] | python | en | ['en', 'en', 'en'] | True |
DjangoAdminSettingsDirectory.test_builtin_with_environment | (self) | directory: django-admin builtin commands succeed if settings are provided in the environment | directory: django-admin builtin commands succeed if settings are provided in the environment | def test_builtin_with_environment(self):
"directory: django-admin builtin commands succeed if settings are provided in the environment"
args = ['sqlall', 'admin_scripts']
out, err = self.run_django_admin(args, 'test_project.settings')
self.assertNoOutput(err)
self.assertOutput(ou... | [
"def",
"test_builtin_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_django_admin",
"(",
"args",
",",
"'test_project.settings'",
")",
"self",
".",
"assertNoOutput",
... | [
643,
4
] | [
648,
46
] | python | en | ['en', 'en', 'en'] | True |
ManageNoSettings.test_builtin_command | (self) | no settings: manage.py builtin commands fail with an error when no settings provided | no settings: manage.py builtin commands fail with an error when no settings provided | def test_builtin_command(self):
"no settings: manage.py builtin commands fail with an error when no settings provided"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args)
self.assertNoOutput(out)
self.assertOutput(err, "No module named '?(test_project\.)?settings'... | [
"def",
"test_builtin_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"assertOutp... | [
660,
4
] | [
665,
91
] | python | en | ['en', 'en', 'en'] | True |
ManageNoSettings.test_builtin_with_bad_settings | (self) | no settings: manage.py builtin commands fail if settings file (from argument) doesn't exist | no settings: manage.py builtin commands fail if settings file (from argument) doesn't exist | def test_builtin_with_bad_settings(self):
"no settings: manage.py builtin commands fail if settings file (from argument) doesn't exist"
args = ['sqlall', '--settings=bad_settings', 'admin_scripts']
out, err = self.run_manage(args)
self.assertNoOutput(out)
self.assertOutput(err, "... | [
"def",
"test_builtin_with_bad_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=bad_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"("... | [
667,
4
] | [
672,
78
] | python | en | ['en', 'en', 'en'] | True |
ManageNoSettings.test_builtin_with_bad_environment | (self) | no settings: manage.py builtin commands fail if settings file (from environment) doesn't exist | no settings: manage.py builtin commands fail if settings file (from environment) doesn't exist | def test_builtin_with_bad_environment(self):
"no settings: manage.py builtin commands fail if settings file (from environment) doesn't exist"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args, 'bad_settings')
self.assertNoOutput(out)
self.assertOutput(err, "No mo... | [
"def",
"test_builtin_with_bad_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
",",
"'bad_settings'",
")",
"self",
".",
"assertNoOutput",
"(",
"out... | [
674,
4
] | [
679,
78
] | python | en | ['en', 'en', 'en'] | True |
ManageDefaultSettings.test_builtin_command | (self) | default: manage.py builtin commands succeed when default settings are appropriate | default: manage.py builtin commands succeed when default settings are appropriate | def test_builtin_command(self):
"default: manage.py builtin commands succeed when default settings are appropriate"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, 'CREATE TABLE') | [
"def",
"test_builtin_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"err",
")",
"self",
".",
"assertOutp... | [
692,
4
] | [
697,
46
] | python | en | ['en', 'en', 'en'] | True |
ManageDefaultSettings.test_builtin_with_settings | (self) | default: manage.py builtin commands succeed if settings are provided as argument | default: manage.py builtin commands succeed if settings are provided as argument | def test_builtin_with_settings(self):
"default: manage.py builtin commands succeed if settings are provided as argument"
args = ['sqlall', '--settings=test_project.settings', 'admin_scripts']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, 'CREATE... | [
"def",
"test_builtin_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=test_project.settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
... | [
699,
4
] | [
704,
46
] | python | en | ['en', 'en', 'en'] | True |
ManageDefaultSettings.test_builtin_with_environment | (self) | default: manage.py builtin commands succeed if settings are provided in the environment | default: manage.py builtin commands succeed if settings are provided in the environment | def test_builtin_with_environment(self):
"default: manage.py builtin commands succeed if settings are provided in the environment"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args, 'test_project.settings')
self.assertNoOutput(err)
self.assertOutput(out, 'CREATE ... | [
"def",
"test_builtin_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
",",
"'test_project.settings'",
")",
"self",
".",
"assertNoOutput",
"(",
... | [
706,
4
] | [
711,
46
] | python | en | ['en', 'en', 'en'] | True |
ManageDefaultSettings.test_builtin_with_bad_settings | (self) | default: manage.py builtin commands succeed if settings file (from argument) doesn't exist | default: manage.py builtin commands succeed if settings file (from argument) doesn't exist | def test_builtin_with_bad_settings(self):
"default: manage.py builtin commands succeed if settings file (from argument) doesn't exist"
args = ['sqlall', '--settings=bad_settings', 'admin_scripts']
out, err = self.run_manage(args)
self.assertNoOutput(out)
self.assertOutput(err, "N... | [
"def",
"test_builtin_with_bad_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=bad_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"("... | [
713,
4
] | [
718,
78
] | python | en | ['en', 'en', 'en'] | True |
ManageDefaultSettings.test_builtin_with_bad_environment | (self) | default: manage.py builtin commands fail if settings file (from environment) doesn't exist | default: manage.py builtin commands fail if settings file (from environment) doesn't exist | def test_builtin_with_bad_environment(self):
"default: manage.py builtin commands fail if settings file (from environment) doesn't exist"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args, 'bad_settings')
self.assertNoOutput(out)
self.assertOutput(err, "No module... | [
"def",
"test_builtin_with_bad_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
",",
"'bad_settings'",
")",
"self",
".",
"assertNoOutput",
"(",
"out... | [
720,
4
] | [
725,
78
] | python | en | ['en', 'en', 'en'] | True |
ManageDefaultSettings.test_custom_command | (self) | default: manage.py can execute user commands when default settings are appropriate | default: manage.py can execute user commands when default settings are appropriate | def test_custom_command(self):
"default: manage.py can execute user commands when default settings are appropriate"
args = ['noargs_command']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, "EXECUTE: noargs_command") | [
"def",
"test_custom_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"err",
")",
"self",
".",
"assertOutput",
"(",
"out",
... | [
727,
4
] | [
732,
57
] | python | en | ['en', 'en', 'en'] | True |
ManageDefaultSettings.test_custom_command_with_settings | (self) | default: manage.py can execute user commands when settings are provided as argument | default: manage.py can execute user commands when settings are provided as argument | def test_custom_command_with_settings(self):
"default: manage.py can execute user commands when settings are provided as argument"
args = ['noargs_command', '--settings=test_project.settings']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, "EXECU... | [
"def",
"test_custom_command_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
",",
"'--settings=test_project.settings'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"err... | [
734,
4
] | [
739,
57
] | python | en | ['en', 'en', 'en'] | True |
ManageDefaultSettings.test_custom_command_with_environment | (self) | default: manage.py can execute user commands when settings are provided in environment | default: manage.py can execute user commands when settings are provided in environment | def test_custom_command_with_environment(self):
"default: manage.py can execute user commands when settings are provided in environment"
args = ['noargs_command']
out, err = self.run_manage(args, 'test_project.settings')
self.assertNoOutput(err)
self.assertOutput(out, "EXECUTE: n... | [
"def",
"test_custom_command_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
",",
"'test_project.settings'",
")",
"self",
".",
"assertNoOutput",
"(",
"err",
")"... | [
741,
4
] | [
746,
57
] | python | en | ['en', 'en', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.