repo_id
stringclasses
400 values
commit_sha
stringclasses
400 values
commit_index
int32
0
951
in_repo_split
stringclasses
1 value
cross_repo_split
stringclasses
1 value
test_file
stringlengths
7
121
test_function
stringlengths
1
108
assertion_type
stringclasses
32 values
difficulty
stringclasses
8 values
context_lines
int32
3
600
prefix
large_stringlengths
44
113k
target
large_stringlengths
1
498
anchor_sha
stringclasses
400 values
anchor_index
int32
0
951
qna_source
stringclasses
1 value
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_management_command.py
test_get_model_to_merge
self.assertEqual
string_literal
41
import os import six import mock import logging import importlib import pytest import sys from django.conf import settings from django.core.management import call_command, find_commands, load_command_class from django.test import TestCase from six import StringIO from django_extensions.management.modelviz import use_...
"two")
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_version.py
test_no_patch_number
self.assertEqual
string_literal
11
from django.test import TestCase from django_extensions import get_version class DjangoExtensionsVersionTests(TestCase): def test_no_patch_number(self): result = get_version((1, 2)) self.assertEqual(result,
'1.2')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_autoslug_fields.py
test_slug_argument_priority_no_overwrite_on_add
self.assertEqual
string_literal
32
import django import pytest import six from django.db import migrations, models from django.db.migrations.writer import MigrationWriter from django.test import TestCase from django.utils.encoding import force_bytes import django_extensions # noqa from django_extensions.db.fields import AutoSlugField from .testapp.mo...
'slug')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_autoslug_fields.py
test_use_custom_slug_function
self.assertEqual
string_literal
32
import django import pytest import six from django.db import migrations, models from django.db.migrations.writer import MigrationWriter from django.test import TestCase from django.utils.encoding import force_bytes import django_extensions # noqa from django_extensions.db.fields import AutoSlugField from .testapp.mo...
'TEST')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_autoslug_fields.py
test_precedence_custom_slug_function
self.assertEqual
string_literal
34
import django import pytest import six from django.db import migrations, models from django.db.migrations.writer import MigrationWriter from django.test import TestCase from django.utils.encoding import force_bytes import django_extensions # noqa from django_extensions.db.fields import AutoSlugField from .testapp.mo...
'test')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_compat.py
test_should_return_default_if_TEMPLATES_setting_is_none
self.assertEqual
string_literal
11
from django.test import TestCase from django.test.utils import override_settings from django_extensions.compat import get_template_setting class CompatTests(TestCase): @override_settings(TEMPLATES=None) def test_should_return_default_if_TEMPLATES_setting_is_none(self): self.assertEqual(get_template_...
'test')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_management_command.py
test_keep_first_or_last_instance
self.assertEqual
string_literal
33
import os import six import mock import logging import importlib import pytest import sys from django.conf import settings from django.core.management import call_command, find_commands, load_command_class from django.test import TestCase from six import StringIO from django_extensions.management.modelviz import use_...
"last")
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_management_command.py
test_keep_first_or_last_instance
self.assertEqual
string_literal
31
import os import six import mock import logging import importlib import pytest import sys from django.conf import settings from django.core.management import call_command, find_commands, load_command_class from django.test import TestCase from six import StringIO from django_extensions.management.modelviz import use_...
"first")
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_version.py
test_patch_number_is_int
self.assertEqual
string_literal
11
from django.test import TestCase from django_extensions import get_version class DjangoExtensionsVersionTests(TestCase): def test_patch_number_is_int(self): result = get_version((1, 2, 3)) self.assertEqual(result,
'1.2.3')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_version.py
test_patch_number_is_str
self.assertEqual
string_literal
11
from django.test import TestCase from django_extensions import get_version class DjangoExtensionsVersionTests(TestCase): def test_patch_number_is_str(self): result = get_version((1, 2, 'pre')) self.assertEqual(result,
'1.2_pre')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_set_default_site.py
test_should_use_domain_as_name_if_system_fqdn_return_domain_and_name_is_not_provided
self.assertEqual
string_literal
20
import six from django.conf import settings from django.contrib.sites.models import Site from django.core.management import call_command from django.core.management.base import CommandError from django.test import TestCase from django.test.utils import override_settings from six import StringIO class SetDefaultSiteTes...
'test.com')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_management_command.py
test_no_models_dot_py
self.assertEqual
string_literal
32
import os import six import mock import logging import importlib import pytest import sys from django.conf import settings from django.core.management import call_command, find_commands, load_command_class from django.test import TestCase from six import StringIO from django_extensions.management.modelviz import use_...
'TeslaCar')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_set_default_site.py
test_should_set_name_only
self.assertEqual
string_literal
18
import six from django.conf import settings from django.contrib.sites.models import Site from django.core.management import call_command from django.core.management.base import CommandError from django.test import TestCase from django.test.utils import override_settings from six import StringIO class SetDefaultSiteTes...
'example.com')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_template_rendering.py
test_simple_template
self.assertEqual
string_literal
12
from django.test import TestCase from django.template import Context, Template class TemplateRenderingTests(TestCase): def setUp(self): self.ctx = Context({ 'worldvar': 'world', }) def test_simple_template(self): self.assertEqual(Template("hello world").render(self.ctx),
"hello world")
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_validators.py
test_should_raise_custom_message_and_code_if_value_contains_tabs
self.assertEqual
string_literal
17
from django.core.exceptions import ValidationError from django.test import TestCase from django_extensions.validators import NoControlCharactersValidator, NoWhitespaceValidator class NoControlCharactersValidatorTests(TestCase): def test_should_raise_custom_message_and_code_if_value_contains_tabs(self): s...
'custom code')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_validators.py
test_should_raise_default_message_and_code_if_value_has_leading_whitespace
self.assertEqual
string_literal
18
from django.core.exceptions import ValidationError from django.test import TestCase from django_extensions.validators import NoControlCharactersValidator, NoWhitespaceValidator class NoWhiteSpaceValidatorTests(TestCase): def test_should_raise_default_message_and_code_if_value_has_leading_whitespace(self): ...
'no_whitespace')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/test_email_notifications.py
test_should_notify_if_notification_level_is_greater_than_0
self.assertEqual
string_literal
28
from django.core import mail from django.core.management import call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO class EmailNotificationCommandTests(TestCase): @override_settings(ADMINS=['foo@bar.com'], DEFAULT_FROM_EMAIL...
'my_script body')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_validators.py
test_should_raise_custom_message_and_code_if_value_contains_tabs
self.assertEqual
string_literal
16
from django.core.exceptions import ValidationError from django.test import TestCase from django_extensions.validators import NoControlCharactersValidator, NoWhitespaceValidator class NoControlCharactersValidatorTests(TestCase): def test_should_raise_custom_message_and_code_if_value_contains_tabs(self): s...
'custom message')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_drop_test_database.py
test_sqlite3_should_unlink_database
assert_*
string_literal
23
import six from django.core.management import CommandError, call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO class DropTestDatabaseTests(TestCase): @override_settings(DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sq...
'test_db.sqlite3')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_reset_db.py
test_should_unlink_database_and_print_success_message
assert_*
string_literal
18
import os import six from django.core.management import CommandError, call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO class ResetDbSqlite3Tests(TestCase): @mock.patch('sys.stdout', new_callable=StringIO) @mock.patch.object(os, 'unlink') ...
'test_db.sqlite3')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_templatetags.py
test_widont
self.assertEqual
string_literal
10
import six from django.template import engines from django.test import TestCase from django_extensions.templatetags.widont import widont, widont_html class TemplateTagsTests(TestCase): def test_widont(self): self.assertEqual(widont('Test Value'),
'Test Value')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_logging_filters.py
test_should_set_cache_key_with_custom_rate_and_return_True
self.assertEqual
string_literal
34
import time from django.test import TestCase from django.test.utils import override_settings from django_extensions.logging.filters import RateLimiterFilter TEST_SUBJECT = 'test_subect' class RateLimiterFilterTests(TestCase): def setUp(self): self.rate_limiter_filter = RateLimiterFilter() self....
'[1x] test_subect')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/test_email_notifications.py
test_should_send_email_with_command_name_and_full_traceback_if_command_fail
self.assertEqual
string_literal
23
from django.core import mail from django.core.management import call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO class EmailNotificationCommandTests(TestCase): @override_settings(ADMINS=['foo@bar.com', 'bar@foo.com'], DEF...
'webmaster@foo.bar')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/test_email_notifications.py
test_should_notify_if_notification_level_is_greater_than_0
self.assertEqual
string_literal
27
from django.core import mail from django.core.management import call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO class EmailNotificationCommandTests(TestCase): @override_settings(ADMINS=['foo@bar.com'], DEFAULT_FROM_EMAIL...
'my_script subject')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/shell_plus_tests/test_shell_plus.py
test_shell_plus_plain_startup_with_pythonrc
assert
string_literal
34
import os import re import six import django import pytest import inspect from django.core.management import call_command from django.db.models import Model from django.test import override_settings from django_extensions.management.commands import shell_plus from django_extensions.management.shells import SHELL_PLUS...
"pythonrc was loaded"
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_logging_filters.py
test_should_modify_record_msg_and_return_True
self.assertEqual
string_literal
32
import time from django.test import TestCase from django.test.utils import override_settings from django_extensions.logging.filters import RateLimiterFilter TEST_SUBJECT = 'test_subect' class RateLimiterFilterTests(TestCase): def setUp(self): self.rate_limiter_filter = RateLimiterFilter() self....
'[999x] test_subect')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_validators.py
test_should_raise_default_message_and_code_if_value_contains_new_line
self.assertEqual
string_literal
17
from django.core.exceptions import ValidationError from django.test import TestCase from django_extensions.validators import NoControlCharactersValidator, NoWhitespaceValidator class NoControlCharactersValidatorTests(TestCase): def test_should_raise_default_message_and_code_if_value_contains_new_line(self): ...
'no_control_characters')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/test_email_notifications.py
test_should_notify_if_notification_level_is_greater_than_0
self.assertEqual
string_literal
29
from django.core import mail from django.core.management import call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO class EmailNotificationCommandTests(TestCase): @override_settings(ADMINS=['foo@bar.com'], DEFAULT_FROM_EMAIL...
'from_email@example.com')
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_dumpscript.py
test_replaced_stdout
self.assertTrue
string_literal
25
import ast import os import shutil import sys import six from django.core.management import call_command from django.test import TestCase, override_settings from .testapp.models import Name, Note, Person, Club class DumpScriptTests(TestCase): def setUp(self): sys.stdout = six.StringIO() sys.stder...
'Mike' in tmp_out.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_dumpscript.py
test_replaced_stderr
self.assertTrue
string_literal
26
import ast import os import shutil import sys import six from django.core.management import call_command from django.test import TestCase, override_settings from .testapp.models import Name, Note, Person, Club class DumpScriptTests(TestCase): def setUp(self): sys.stdout = six.StringIO() sys.stder...
'Name' in tmp_err.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_dumpscript.py
test_replaced_stderr
self.assertTrue
string_literal
25
import ast import os import shutil import sys import six from django.core.management import call_command from django.test import TestCase, override_settings from .testapp.models import Name, Note, Person, Club class DumpScriptTests(TestCase): def setUp(self): sys.stdout = six.StringIO() sys.stder...
'Fred' in sys.stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_dumpscript.py
test_runs
self.assertTrue
string_literal
23
import ast import os import shutil import sys import six from django.core.management import call_command from django.test import TestCase, override_settings from .testapp.models import Name, Note, Person, Club class DumpScriptTests(TestCase): def setUp(self): sys.stdout = six.StringIO() sys.stder...
'Gabriel' in sys.stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/shell_plus_tests/test_import_subclasses.py
assert_imports
assert_*
func_call
29
from typing import Optional, Set # noqa from django.conf import settings from django.test.utils import override_settings from tests.management.commands.shell_plus_tests.test_utils import AutomaticShellPlusImportsTestCase from tests.test_module_in_project_dir import FourthDerivedClass from tests.testapp.derived_class...
set())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/shell_plus_tests/test_import_subclasses.py
assert_imports
assert_*
func_call
25
from typing import Optional, Set # noqa from django.conf import settings from django.test.utils import override_settings from tests.management.commands.shell_plus_tests.test_utils import AutomaticShellPlusImportsTestCase from tests.test_module_in_project_dir import FourthDerivedClass from tests.testapp.derived_class...
first or set())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/shell_plus_tests/test_import_subclasses.py
assert_imports
assert_*
func_call
27
from typing import Optional, Set # noqa from django.conf import settings from django.test.utils import override_settings from tests.management.commands.shell_plus_tests.test_utils import AutomaticShellPlusImportsTestCase from tests.test_module_in_project_dir import FourthDerivedClass from tests.testapp.derived_class...
third or set())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_update_permissions.py
test_works
self.assertIn
func_call
28
import sys from django.contrib.auth.models import Permission from django.core.management import call_command from django.db import models from django.test import TestCase from six import StringIO class UpdatePermissionsTests(TestCase): def setUp(self): class PermModel(models.Model): class Met...
out.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_clean_pyc.py
test_takes_path
self.assertEqual
func_call
35
import fnmatch import os import shutil import six from django.core.management import call_command from django.test import TestCase class CleanPycTests(TestCase): def setUp(self): self.project_root = os.path.join('tests', 'testapp') self._settings = os.environ.get('DJANGO_SETTINGS_MODULE') ...
sorted(output))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_compile_pyc.py
test_takes_path
self.assertEqual
func_call
36
import fnmatch import os import six from django.core.management import call_command from django.test import TestCase class CompilePycTests(TestCase): def setUp(self): self.project_root = os.path.join('tests', 'testapp') self._settings = os.environ.get('DJANGO_SETTINGS_MODULE') os.environ['...
sorted(output))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_shortuuid_field.py
test_UUID_field_pk_agregate_create
self.assertTrue
func_call
16
import six from django.test import TestCase from .testapp.models import ( ShortUUIDTestAgregateModel, ShortUUIDTestManyToManyModel, ShortUUIDTestModel_field, ShortUUIDTestModel_pk, ) class ShortUUIDFieldTest(TestCase): def test_UUID_field_pk_agregate_create(self): j = ShortUUIDTestAgregateModel.o...
len(j.pk) < 23)
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/shell_plus_tests/test_import_subclasses.py
assert_imports
assert_*
func_call
26
from typing import Optional, Set # noqa from django.conf import settings from django.test.utils import override_settings from tests.management.commands.shell_plus_tests.test_utils import AutomaticShellPlusImportsTestCase from tests.test_module_in_project_dir import FourthDerivedClass from tests.testapp.derived_class...
second or set())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/shell_plus_tests/test_import_subclasses.py
assert_imports
assert_*
func_call
28
from typing import Optional, Set # noqa from django.conf import settings from django.test.utils import override_settings from tests.management.commands.shell_plus_tests.test_utils import AutomaticShellPlusImportsTestCase from tests.test_module_in_project_dir import FourthDerivedClass from tests.testapp.derived_class...
fourth or set())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_clean_pyc.py
test_removes_pyc_files
self.assertTrue
func_call
31
import fnmatch import os import shutil import six from django.core.management import call_command from django.test import TestCase class CleanPycTests(TestCase): def setUp(self): self.project_root = os.path.join('tests', 'testapp') self._settings = os.environ.get('DJANGO_SETTINGS_MODULE') ...
len(pyc_glob) > 0)
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_compile_pyc.py
test_compiles_pyc_files
self.assertTrue
func_call
34
import fnmatch import os import six from django.core.management import call_command from django.test import TestCase class CompilePycTests(TestCase): def setUp(self): self.project_root = os.path.join('tests', 'testapp') self._settings = os.environ.get('DJANGO_SETTINGS_MODULE') os.environ['...
len(pyc_glob) > 0)
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_admin_generator.py
test_should_print_admin_class_for_User_model_only
self.assertIn
func_call
15
from django.core.management import call_command from django.db import models from django.test import TestCase from six import PY3, StringIO class AdminGeneratorTests(TestCase): def setUp(self): self.out = StringIO() def test_should_print_admin_class_for_User_model_only(self): call_command('ad...
self.out.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_clear_cache.py
test_called_with_explicit_all
self.assertIn
func_call
33
import mock import os import six from django.core.management import call_command from django.core.management.base import CommandError from django.test import TestCase DefaultCacheMock = mock.Mock() OtherCacheMock = mock.Mock() class ClearCacheTests(TestCase): def setUp(self): self.project_root = os.path....
self.out.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_create_command.py
test_should_print_management_command_files_only_on_dry_run
self.assertIn
func_call
51
import os import shutil from django.conf import settings from django.core.management import call_command from django.test import TestCase from six import StringIO TEST_APP = 'testapp_with_appconfig' class CreateCommandTests(TestCase): def setUp(self): # noqa self.management_command_path = os.path.join(...
m_stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_create_command.py
test_should_print_error_on_OSError_exception
self.assertIn
func_call
55
import os import shutil from django.conf import settings from django.core.management import call_command from django.test import TestCase from six import StringIO TEST_APP = 'testapp_with_appconfig' class CreateCommandTests(TestCase): def setUp(self): # noqa self.management_command_path = os.path.join(...
m_stderr.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_create_jobs.py
test_should_create_jobs_directory_structure_and_print_SUCCESS_message
self.assertIn
func_call
22
import os import six import shutil from django.core.management import call_command from django.test import TestCase from six import StringIO from tests import testapp_with_no_models_file JOBS_DIR = os.path.join(testapp_with_no_models_file.__path__[0], 'jobs') TIME_PERIODS = ['hourly', 'daily', 'weekly', 'monthly', 'y...
m_stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_describe_form.py
test_should_print_form_definition_for_TestModel
self.assertIn
func_call
37
import six from django.test import TestCase from django.db import models from django.core.management import CommandError, call_command class DescribeFormTests(TestCase): def setUp(self): self.out = six.StringIO() class BaseModel(models.Model): title = models.CharField(max_length=50) ...
self.out.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_drop_test_database.py
test_should_raise_CommandError_if_router_is_unknown
self.assertEqual
func_call
17
import six from django.core.management import CommandError, call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO class DropTestDatabaseTests(TestCase): @patch('sys.stdout', new_callable=StringIO) @patch('django_extensions.management.commands.dr...
m_stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_generate_secret_key.py
test_should_return_random_secret_key
self.assertIn
func_call
23
from distutils.version import LooseVersion import pytest from django import get_version from django.core.management import call_command from django.test import TestCase from six import StringIO class GenerateSecretKeyTests(TestCase): @pytest.mark.skipif( LooseVersion(get_version()) <= LooseVersion('1.10....
m_stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_print_user_for_session.py
test_should_print_Session_Key_does_not_exist_or_expired
self.assertIn
func_call
20
import six from importlib import import_module from io import StringIO from django.conf import settings from django.contrib.auth import get_user_model from django.core.management import CommandError, call_command from django.test import TestCase class PrintUserForSessionTests(TestCase): def setUp(self): ...
m_stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_reset_db.py
test_should_cancel_reset_db_if_input_is_different_than_yes
self.assertEqual
func_call
17
import os import six from django.core.management import CommandError, call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO class ResetDbSqlite3Tests(TestCase): @mock.patch('sys.stdout', new_callable=StringIO) @mock.patch('django_extensions.man...
m_stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_reset_schema.py
test_should_cancel_reset_schema_and_print_info_if_input_is_different_than_yes
self.assertEqual
func_call
17
import six from django.core.management import CommandError, call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO class ResetSchemaTests(TestCase): @mock.patch('sys.stdout', new_callable=StringIO) @mock.patch('django_extensions.management.comman...
m_stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_set_default_site.py
test_should_print_Nothing_to_update
self.assertIn
func_call
17
import six from django.conf import settings from django.contrib.sites.models import Site from django.core.management import call_command from django.core.management.base import CommandError from django.test import TestCase from django.test.utils import override_settings from six import StringIO class SetDefaultSiteTes...
m_stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_show_urls.py
test_should_show_urls_in_table_format
self.assertIn
func_call
20
import six from django.conf.urls import url from django.core.management import CommandError, call_command from django.http import HttpResponse from django.test import TestCase from django.test.utils import override_settings from django.views.generic.base import View from six import StringIO def function_based_view(req...
m_stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_sqlcreate.py
test_should_print_SQL_create_database_statement_for_mysql
self.assertEqual
func_call
48
import six from django.core.management import CommandError, call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO MYSQL_DATABASE_SETTINGS = { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'dbatabase', 'USER': 'foo', 'PASSWORD': 'bar', ...
m_stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_sqlcreate.py
test_should_print_SQL_create_database_statement_for_mysql
self.assertEqual
func_call
49
import six from django.core.management import CommandError, call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO MYSQL_DATABASE_SETTINGS = { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'dbatabase', 'USER': 'foo', 'PASSWORD': 'bar', ...
m_stderr.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_sqldsn.py
test_should_print_info_for_default_sqlite3_router
self.assertEqual
func_call
68
from django.core.management import CommandError, call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO MYSQL_DATABASE_SETTINGS = { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'dbatabase', 'USER': 'foo', 'PASSWORD': 'bar', 'HOST': '1...
m_stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_sync_s3.py
test_should_raise_CommandError_when_medi
self.assertIn
func_call
28
import os import six import shutil from django.conf import settings from django.core.management import CommandError, call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO from django_extensions.management.commands.sync_s3 import Command class SyncS3Com...
m_stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_syncdata.py
test_should_return_SyncDataError_when_unknown_fixture_format
self.assertEqual
func_call
20
import os from distutils.version import LooseVersion import pytest from django import get_version from django.contrib.auth.models import User from django.core.management import call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO TEST_FIXTURE_DIR = os....
m_stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_unreferenced_files.py
test_should_not_print_any_output
self.assertIs
func_call
28
import os import six import shutil from tempfile import mkdtemp from django.core.management import CommandError, call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO from ...testapp.models import Photo class UnreferencedFilesTests(TestCase): def ...
m_stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/test_email_notifications.py
test_should_print_that_no_email_recipients_available
self.assertIn
func_call
17
from django.core import mail from django.core.management import call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO class EmailNotificationCommandTests(TestCase): @override_settings(ADMINS=[]) @patch('sys.stdout', new_callable=StringIO) de...
m_stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_find_template.py
test_finding_template
self.assertIn
func_call
12
from django.core.management import call_command from django.test import TestCase from six import StringIO class FindTemplateTests(TestCase): @patch('sys.stdout', new_callable=StringIO) def test_finding_template(self, m_stdout): call_command('find_template', 'admin/change_form.html') self.ass...
m_stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_find_template.py
test_should_print_error_when_template_not_found
self.assertIn
func_call
12
from django.core.management import call_command from django.test import TestCase from six import StringIO class FindTemplateTests(TestCase): @patch('sys.stderr', new_callable=StringIO) def test_should_print_error_when_template_not_found(self, m_stderr): call_command('find_template', 'not_found_templat...
m_stderr.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_runjob.py
test_runs
self.assertIn
func_call
17
import sys import six from django.core.management import call_command from django.test import TestCase class RunJobTests(TestCase): def setUp(self): sys.stdout = six.StringIO() sys.stderr = six.StringIO() def test_runs(self): # lame test...does it run? call_command('runjob', ...
sys.stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_runscript.py
test_runs
self.assertIn
func_call
21
import os import six import sys import importlib from django.core.management import call_command from django.test import TestCase, override_settings from django_extensions.management.commands.runscript import BadCustomDirectoryException, DirPolicyChoices class RunScriptTests(TestCase): def setUp(self): ...
sys.stdout.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_runscript.py
test_doesnt_print_exception_for_nonexistent_script_when_no_traceback
self.assertEqual
func_call
16
import os import six import sys import importlib from django.core.management import call_command from django.test import TestCase, override_settings from django_extensions.management.commands.runscript import BadCustomDirectoryException, DirPolicyChoices class NonExistentScriptsTests(RunScriptTests): def test_d...
sys.stderr.getvalue())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/jobs/daily/test_cache_cleanup.py
test_remove_all_keys_from_DatabaseCache
self.assertIsNone
func_call
22
from django.core.cache import caches from django.core.management import call_command from django.test import TestCase from django.test.utils import override_settings class CacheCleanupTests(TestCase): @override_settings(CACHES={ 'test_cache': { 'BACKEND': 'django.core.cache.backends.db.Databas...
db_cache.get('my_key'))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_json_field.py
test_to_python
self.assertEqual
func_call
19
import six from django.test import TestCase from .testapp.models import JSONFieldTestModel from django_extensions.db.fields.json import ( dumps, loads, JSONField, JSONDict, JSONList ) class JsonFieldTest(TestCase): def test_to_python(self): j_field = JSONField() self
j_field.to_python('1'))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_create_command.py
test_should_print_management_command_files_only_on_dry_run
self.assertFalse
func_call
52
import os import shutil from django.conf import settings from django.core.management import call_command from django.test import TestCase from six import StringIO TEST_APP = 'testapp_with_appconfig' class CreateCommandTests(TestCase): def setUp(self): # noqa self.management_command_path = os.path.join(...
os.path.isfile(filepath))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_create_jobs.py
test_should_create_jobs_directory_structure_silently
self.assertTrue
func_call
19
import os import six import shutil from django.core.management import call_command from django.test import TestCase from six import StringIO from tests import testapp_with_no_models_file JOBS_DIR = os.path.join(testapp_with_no_models_file.__path__[0], 'jobs') TIME_PERIODS = ['hourly', 'daily', 'weekly', 'monthly', 'y...
os.path.exists(JOBS_DIR))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_templatetags.py
test_widont
self.assertEqual
func_call
11
import six from django.template import engines from django.test import TestCase from django_extensions.templatetags.widont import widont, widont_html class TemplateTagsTests(TestCase): def test_widont(self): self.assertEqual(widont('Test Value'), 'Test&nbsp;Value') self.assertEqual(widont(six.u('...
six.u('Test&nbsp;Value'))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_dumpscript.py
test_replaced_stdout
self.assertEqual
func_call
26
import ast import os import shutil import sys import six from django.core.management import call_command from django.test import TestCase, override_settings from .testapp.models import Name, Note, Person, Club class DumpScriptTests(TestCase): def setUp(self): sys.stdout = six.StringIO() sys.stder...
len(sys.stdout.getvalue()))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_dumpscript.py
test_replaced_stderr
self.assertEqual
func_call
27
import ast import os import shutil import sys import six from django.core.management import call_command from django.test import TestCase, override_settings from .testapp.models import Name, Note, Person, Club class DumpScriptTests(TestCase): def setUp(self): sys.stdout = six.StringIO() sys.stder...
len(sys.stderr.getvalue()))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_create_jobs.py
test_should_not_override_already_created_jobs_directory_structure_and_print_that_already_exists
self.assertIn
func_call
27
import os import six import shutil from django.core.management import call_command from django.test import TestCase from six import StringIO from tests import testapp_with_no_models_file JOBS_DIR = os.path.join(testapp_with_no_models_file.__path__[0], 'jobs') TIME_PERIODS = ['hourly', 'daily', 'weekly', 'monthly', 'y...
open(sample_file_path).read())
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_pipchecker.py
test_pipchecker_with_outdated_requirement
self.assertTrue
func_call
37
import importlib import os import subprocess import sys import pip import pytest from django.core.management import call_command from django.test import TestCase from six import StringIO from pip._internal.exceptions import InstallationError class PipCheckerTests(TestCase): def test_pipchecker_with_outdated_requ...
value.endswith('available\n'))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_dumpscript.py
test_valid_syntax
self.assertTrue
func_call
37
import ast import os import shutil import sys import six from django.core.management import call_command from django.test import TestCase, override_settings from .testapp.models import Name, Note, Person, Club class DumpScriptTests(TestCase): def setUp(self): sys.stdout = six.StringIO() sys.stder...
len(ast_syntax_tree.body) > 1)
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_admin_widgets.py
test_widget_works
self.assertListEqual
func_call
47
from django.test import TestCase from django.utils.text import Truncator from django_extensions.admin import widgets from .testapp import models class ForeignKeySearchInputTestCase(TestCase): def test_widget_works(self): name = models.Name.objects.create(name="Name") person = models.Person.objec...
list(widget.media._css['all']))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_shortuuid_field.py
test_UUID_field_create
self.assertEqual
func_call
13
import six from django.test import TestCase from .testapp.models import ( ShortUUIDTestAgregateModel, ShortUUIDTestManyToManyModel, ShortUUIDTestModel_field, ShortUUIDTestModel_pk, ) class ShortUUIDFieldTest(TestCase): def test_UUID_field_create(self): j = ShortUUIDTestModel_field.objects.create(a...
six.u('vytxeTZskVKR7C7WgdSP3d'))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_shortuuid_field.py
test_UUID_field_manytomany_create
self.assertEqual
func_call
14
import six from django.test import TestCase from .testapp.models import ( ShortUUIDTestAgregateModel, ShortUUIDTestManyToManyModel, ShortUUIDTestModel_field, ShortUUIDTestModel_pk, ) class ShortUUIDFieldTest(TestCase): def test_UUID_field_manytomany_create(self): j = ShortUUIDTestManyToManyModel....
six.u('vytxeTZskVKR7C7WgdSP3e'))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/db/fields/test_uniq_field_mixin.py
test_find_unique
self.assertTrue
func_call
74
import six from django.db import models from django.test import TestCase from tests.testapp.models import ( DummyRelationModel, InheritedFromPostWithUniqField, PostWithUniqField, ReverseModel, SecondDummyRelationModel, ThirdDummyRelationModel, ) from django_extensions.db.fields import UniqueFieldMixin class U...
hasattr(self.post, 'uniq_field'))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_pipchecker.py
test_pipchecker_with_not_installed_requirement
self.assertTrue
func_call
31
import importlib import os import subprocess import sys import pip import pytest from django.core.management import call_command from django.test import TestCase from six import StringIO from pip._internal.exceptions import InstallationError class PipCheckerTests(TestCase): def test_pipchecker_with_not_installed...
value.endswith('not installed\n'))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_dumpscript.py
test_valid_syntax
self.assertTrue
func_call
39
import ast import os import shutil import sys import six from django.core.management import call_command from django.test import TestCase, override_settings from .testapp.models import Name, Note, Person, Club class DumpScriptTests(TestCase): def setUp(self): sys.stdout = six.StringIO() sys.stder...
len(ast_syntax_tree.asList()) > 1)
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_compat.py
test_should_return_None_by_default_if_TEMPLATES_setting_is_none
self.assertIsNone
func_call
11
from django.test import TestCase from django.test.utils import override_settings from django_extensions.compat import get_template_setting class CompatTests(TestCase): @override_settings(TEMPLATES=None) def test_should_return_None_by_default_if_TEMPLATES_setting_is_none(self): self.assertIsNone(
get_template_setting('template_key'))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_pipchecker.py
test_pipchecker_with_github_url_requirement
self.assertTrue
func_call
37
import importlib import os import subprocess import sys import pip import pytest from django.core.management import call_command from django.test import TestCase from six import StringIO from pip._internal.exceptions import InstallationError class PipCheckerTests(TestCase): def test_pipchecker_with_github_url_re...
value.endswith('repo is not frozen\n'))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/test_delete_squashed_migrations.py
test_should_delete_squashed_migrations
self.assertFalse
func_call
32
import os import six from distutils.version import LooseVersion import pytest from django import get_version from django.core.management import CommandError, call_command from django.db import models from django.test import TestCase, override_settings from tests import testapp_with_appconfig MIGRATIONS_DIR = os.path....
self.migration_exists('0001_initial.py'))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/test_email_notifications.py
test_should_print_that_no_email_recipients_available
self.assertListEqual
collection
18
from django.core import mail from django.core.management import call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO class EmailNotificationCommandTests(TestCase): @override_settings(ADMINS=[]) @patch('sys.stdout', new_callable=StringIO) de...
[])
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_json_field.py
test_default
self.assertEqual
collection
18
import six from django.test import TestCase from .testapp.models import JSONFieldTestModel from django_extensions.db.fields.json import ( dumps, loads, JSONField, JSONDict, JSONList ) class JsonFieldTest(TestCase): def test_default(self): j = JSONFieldTestModel.objects.create(a=1) ...
{})
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_json_field.py
test_empty_list
self.assertEqual
collection
19
import six from django.test import TestCase from .testapp.models import JSONFieldTestModel from django_extensions.db.fields.json import ( dumps, loads, JSONField, JSONDict, JSONList ) class JsonFieldTest(TestCase): def test_empty_list(self): j = JSONFieldTestModel.objects.create(a=6, ...
[])
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_json_field.py
test_get_default
self.assertEqual
collection
34
import six from django.test import TestCase from .testapp.models import JSONFieldTestModel from django_extensions.db.fields.json import ( dumps, loads, JSONField, JSONDict, JSONList ) class JsonFieldTest(TestCase): def test_get_default(self): j_field = JSONField() value = j_fi...
[{}])
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_json_field.py
test_char_field_create
self.assertEqual
collection
18
import six from django.test import TestCase from .testapp.models import JSONFieldTestModel from django_extensions.db.fields.json import ( dumps, loads, JSONField, JSONDict, JSONList ) class JsonFieldTest(TestCase): def test_char_field_create(self): j = JSONFieldTestModel.objects.create...
{'foo': 'bar'})
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_parse_mysql_cnf.py
test_should_return_empty_strings_if_read_default_file_option_is_missing
self.assertEqual
collection
23
import os import shutil from tempfile import mkdtemp from django.test import TestCase from django_extensions.management.mysql import parse_mysql_cnf class ParseMysqlCnfTests(TestCase): def setUpClass(cls): cls.tmpdir = mkdtemp() def tearDownClass(cls): shutil.rmtree(cls.tmpdir) def tes...
('', '', '', '', ''))
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/test_email_notifications.py
test_should_send_email_with_command_name_and_full_traceback_if_command_fail
self.assertListEqual
collection
24
from django.core import mail from django.core.management import call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO class EmailNotificationCommandTests(TestCase): @override_settings(ADMINS=['foo@bar.com', 'bar@foo.com'], DEF...
['foo@bar.com', 'bar@foo.com'])
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_validators.py
test_should_raise_default_message_and_code_if_value_has_leading_whitespace
self.assertDictEqual
collection
19
from django.core.exceptions import ValidationError from django.test import TestCase from django_extensions.validators import NoControlCharactersValidator, NoWhitespaceValidator class NoWhiteSpaceValidatorTests(TestCase): def test_should_raise_default_message_and_code_if_value_has_leading_whitespace(self): ...
{'value': value_with_leading_whitespace})
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/test_email_notifications.py
test_should_notify_if_notification_level_is_greater_than_0
self.assertListEqual
collection
30
from django.core import mail from django.core.management import call_command from django.test import TestCase from django.test.utils import override_settings from six import StringIO class EmailNotificationCommandTests(TestCase): @override_settings(ADMINS=['foo@bar.com'], DEFAULT_FROM_EMAIL...
['recipient0@example.com', 'foo@bar.com'])
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_validators.py
test_should_raise_custom_message_and_code_if_value_has_trailing_whitespace
self.assertDictEqual
collection
18
from django.core.exceptions import ValidationError from django.test import TestCase from django_extensions.validators import NoControlCharactersValidator, NoWhitespaceValidator class NoWhiteSpaceValidatorTests(TestCase): def test_should_raise_custom_message_and_code_if_value_has_trailing_whitespace(self): ...
{'value': value_with_trailing_whitespace})
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_validators.py
test_should_raise_custom_message_and_code_if_value_contains_tabs
self.assertDictEqual
collection
18
from django.core.exceptions import ValidationError from django.test import TestCase from django_extensions.validators import NoControlCharactersValidator, NoWhitespaceValidator class NoControlCharactersValidatorTests(TestCase): def test_should_raise_custom_message_and_code_if_value_contains_tabs(self): s...
{'value': value_with_tabs, 'whitelist': None})
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/test_validators.py
test_should_raise_default_message_and_code_if_value_contains_new_line
self.assertDictEqual
collection
18
from django.core.exceptions import ValidationError from django.test import TestCase from django_extensions.validators import NoControlCharactersValidator, NoWhitespaceValidator class NoControlCharactersValidatorTests(TestCase): def test_should_raise_default_message_and_code_if_value_contains_new_line(self): ...
{'value': value_with_new_line, 'whitelist': None})
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor
django-extensions/django-extensions
b67880aef2de6acda0b4842191e9eb281c2343a3
245
train
train
tests/management/commands/shell_plus_tests/test_shell_plus.py
test_shell_plus_loading_models
assert_*
bool_literal
23
import os import re import six import django import pytest import inspect from django.core.management import call_command from django.db.models import Model from django.test import override_settings from django_extensions.management.commands import shell_plus from django_extensions.management.shells import SHELL_PLUS...
True)
b67880aef2de6acda0b4842191e9eb281c2343a3
245
v2_extractor_at_anchor