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-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_message.py | test_message_component_name_is_none | assert_* | string_literal | 22 | import time
from uuid import uuid4
import pytest
from django.http import JsonResponse
from django_unicorn.errors import ComponentClassLoadError, ComponentModuleLoadError
from django_unicorn.views import message
def assert_json_error(response, error):
assert isinstance(response, JsonResponse)
assert response.... | "Missing component name in url") | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_target.py | test_message_target_id | assert | string_literal | 37 | import time
import shortuuid
from bs4 import BeautifulSoup
from django_unicorn.components import UnicornView
from django_unicorn.utils import generate_checksum
def test_message_target_id(client):
data = {"clicked": False}
message = {
"actionQueue": [
{
"payload": {"name": ... | '<div id="test-target-id"></div>' | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_utils.py | test_generate_checksum_invalid | assert | string_literal | 19 | import pytest
from django.template.backends.django import Template
from django_unicorn.utils import (
create_template,
generate_checksum,
get_method_arguments,
is_non_string_sequence,
sanitize_html,
)
def test_generate_checksum_invalid(settings):
settings.SECRET_KEY = "asdf"
with pytest.r... | "TypeError: Invalid type: <class 'list'>" | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/test_unicorn_view_init.py | test_init_no_component_id | assert | string_literal | 11 | import pytest
from django.template.backends.django import Template
from django_unicorn.components import UnicornView
def test_init_no_component_id():
with pytest.raises(AssertionError) as e:
UnicornView(component_name="test")
assert e.exconly() == | "AssertionError: Component id is required" | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_settings.py | test_get_morpher_settings | assert | string_literal | 24 | import pytest
from django_unicorn.settings import (
get_cache_alias,
get_minify_html_enabled,
get_morpher_settings,
get_script_location,
get_serial_enabled,
)
def test_get_morpher_settings(settings):
assert get_morpher_settings() == {"NAME": "morphdom"}
settings.UNICORN["MORPHER"] = {"NAM... | "AssertionError: Unknown morpher name: blob" | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/test_unicorn_view_init.py | test_init_no_component_name | assert | string_literal | 11 | import pytest
from django.template.backends.django import Template
from django_unicorn.components import UnicornView
def test_init_no_component_name():
with pytest.raises(AssertionError) as e:
UnicornView()
assert e.exconly() == | "AssertionError: Component name is required" | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/components/test_component.py | test_init_with_get_template_names | assert | none_literal | 23 | import types
import orjson
import pytest
from tests.views.fake_components import (
FakeAuthenticationComponent,
FakeValidationComponent,
)
from django_unicorn.components import UnicornView
from django_unicorn.serializer import InvalidFieldNameError
def component():
return ExampleComponent(component_id="a... | None | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_cacher.py | test_cacheable_component_request_is_none_then_restored | assert | none_literal | 19 | from unittest.mock import MagicMock, patch
from django_unicorn.cacher import (
CacheableComponent,
cache_full_tree,
restore_from_cache,
)
from django_unicorn.components import UnicornView
def test_cacheable_component_request_is_none_then_restored():
component = FakeComponent(
component_id="tes... | None | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_model_lifecycle.py | test_model | assert | none_literal | 23 | import pytest
from django_unicorn.components import UnicornView
from django_unicorn.serializer import dumps, loads
from django_unicorn.typer import _construct_model
from django_unicorn.views.utils import set_property_from_data
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_model():
flavo... | None | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_typer.py | test_cast_value_model_none | assert | none_literal | 20 | import datetime
from dataclasses import dataclass
from typing import List, Optional
from typing import get_type_hints as typing_get_type_hints
from pydantic import BaseModel
from django_unicorn.components import UnicornView
from django_unicorn.typer import cast_attribute_value, cast_value, get_type_hints
from example... | None | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/action_parsers/call_method/test_call_method_name.py | test_call_method_name_missing | assert | none_literal | 17 | from datetime import date, datetime, time, timedelta
from types import MappingProxyType
from typing import Optional, Union
from uuid import UUID, uuid4
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.call_method import _call_method_name
from example.coffee.mode... | None | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_target.py | test_message_target_id | assert | none_literal | 34 | import time
import shortuuid
from bs4 import BeautifulSoup
from django_unicorn.components import UnicornView
from django_unicorn.utils import generate_checksum
def test_message_target_id(client):
data = {"clicked": False}
message = {
"actionQueue": [
{
"payload": {"name": ... | None | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/test_is_component_field_model_or_unicorn_field.py | test_type_hint | assert | none_literal | 12 | from django_unicorn.components import UnicornView
from django_unicorn.views.utils import _is_component_field_model_or_unicorn_field
from example.coffee.models import Flavor
def test_type_hint():
component = TypeHintView(component_name="asdf", component_id="test_type_hint")
name = "model"
actual = _is_compo... | None | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/components/test_is_html_well_formed.py | test_is_html_well_formed | assert | bool_literal | 12 | from django_unicorn.components.unicorn_template_response import is_html_well_formed
def test_is_html_well_formed():
html = """
<div>
something
</div>
"""
actual = is_html_well_formed(html)
assert actual is | True | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/templatetags/test_unicorn_scripts.py | test_unicorn_scripts | assert | bool_literal | 9 | from django_unicorn.templatetags.unicorn import unicorn_scripts
def test_unicorn_scripts():
actual = unicorn_scripts()
assert actual["CSRF_HEADER_NAME"] == "X-CSRFTOKEN"
assert actual["CSRF_COOKIE_NAME"] == "csrftoken"
assert actual["MINIFIED"] is | True | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_settings.py | test_get_serial_enabled | assert | bool_literal | 17 | import pytest
from django_unicorn.settings import (
get_cache_alias,
get_minify_html_enabled,
get_morpher_settings,
get_script_location,
get_serial_enabled,
)
def test_get_serial_enabled(settings):
settings.UNICORN["SERIAL"]["ENABLED"] = False
assert get_serial_enabled() is False
sett... | True | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_call_method_multiple.py | test_message_two | assert | bool_literal | 67 | import time
from copy import deepcopy
from multiprocessing.dummy import Pool as ThreadPool
import orjson
import pytest
import shortuuid
from django_unicorn.components import UnicornView
from django_unicorn.utils import generate_checksum
def _set_serial(
settings,
enabled,
timeout,
cache_backend="djan... | True | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_get_property_value.py | test_get_property_value | assert | bool_literal | 16 | from tests.views.fake_components import FakeComponent
from django_unicorn.views.action_parsers.call_method import _get_property_value
def test_get_property_value():
component = FakeComponent(component_name="test", component_id="asdf")
component.check = False
check_value = _get_property_value(component, "... | True | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_set_property.py | test_setter | assert | bool_literal | 34 | import time
import orjson
import shortuuid
from django_unicorn.utils import generate_checksum
def _post_message_and_get_body(client, message, url="/message/tests.views.fake_components.FakeComponent"):
response = client.post(
url,
message,
content_type="application/json",
)
body =... | True | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_target.py | test_message_generated_checksum_matches_dom_checksum | assert | bool_literal | 37 | import time
import shortuuid
from bs4 import BeautifulSoup
from django_unicorn.components import UnicornView
from django_unicorn.utils import generate_checksum
def test_message_generated_checksum_matches_dom_checksum(client):
data = {"clicked": False}
message = {
"actionQueue": [
{
... | True | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_toggle.py | test_message_toggle | assert | bool_literal | 34 | import time
import orjson
import shortuuid
from django_unicorn.utils import generate_checksum
def _post_message_and_get_body(client, message):
response = client.post(
"/message/tests.views.fake_components.FakeComponent",
message,
content_type="application/json",
)
body = orjson.l... | True | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/components/test_component.py | test_is_public_protected | assert | bool_literal | 18 | import types
import orjson
import pytest
from tests.views.fake_components import (
FakeAuthenticationComponent,
FakeValidationComponent,
)
from django_unicorn.components import UnicornView
from django_unicorn.serializer import InvalidFieldNameError
def component():
return ExampleComponent(component_id="a... | False | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/components/test_is_html_well_formed.py | test_is_html_well_formed_missing_internal | assert | bool_literal | 14 | from django_unicorn.components.unicorn_template_response import is_html_well_formed
def test_is_html_well_formed_missing_internal():
html = """
<p>
<div>
something
<br />
</p>
"""
actual = is_html_well_formed(html)
assert actual is | False | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/templatetags/test_unicorn_scripts.py | test_unicorn_scripts_debug | assert | bool_literal | 10 | from django_unicorn.templatetags.unicorn import unicorn_scripts
def test_unicorn_scripts_debug(settings):
settings.DEBUG = True
actual = unicorn_scripts()
assert actual["CSRF_HEADER_NAME"] == "X-CSRFTOKEN"
assert actual["CSRF_COOKIE_NAME"] == "csrftoken"
assert actual["MINIFIED"] is | False | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_settings.py | test_get_serial_enabled | assert | bool_literal | 14 | import pytest
from django_unicorn.settings import (
get_cache_alias,
get_minify_html_enabled,
get_morpher_settings,
get_script_location,
get_serial_enabled,
)
def test_get_serial_enabled(settings):
settings.UNICORN["SERIAL"]["ENABLED"] = False
assert get_serial_enabled() is | False | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_model_lifecycle.py | test_model | assert | complex_expr | 21 | import pytest
from django_unicorn.components import UnicornView
from django_unicorn.serializer import dumps, loads
from django_unicorn.typer import _construct_model
from django_unicorn.views.utils import set_property_from_data
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_model():
flavo... | flavor.id | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_model_lifecycle.py | test_model_foreign_key | assert | complex_expr | 25 | import pytest
from django_unicorn.components import UnicornView
from django_unicorn.serializer import dumps, loads
from django_unicorn.typer import _construct_model
from django_unicorn.views.utils import set_property_from_data
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_model_foreign_key(... | parent.id | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/action_parsers/call_method/test_call_method_name.py | test_call_method_name_arg_with_model_type_annotation | assert | complex_expr | 23 | from datetime import date, datetime, time, timedelta
from types import MappingProxyType
from typing import Optional, Union
from uuid import UUID, uuid4
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.call_method import _call_method_name
from example.coffee.mode... | flavor.pk | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/test_unicorn_set_property_value.py | test_set_property_value_foreign_key | assert | complex_expr | 29 | from dataclasses import dataclass
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.utils import set_property_value
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_set_property_value_foreign_key():
flavor = Flavor(name="initial 1")
... | parent.pk | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/utils/test_construct_model.py | test_construct_model_foreign_key | assert | complex_expr | 23 | import pytest
from django_unicorn.typer import _construct_model
from example.books.models import Author, Book
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_construct_model_foreign_key():
flavor = Flavor(name="first-flavor")
flavor.save()
parent = Flavor(name="parent-flavor")
... | flavor.pk | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/utils/test_construct_model.py | test_construct_model_foreign_key | assert | complex_expr | 25 | import pytest
from django_unicorn.typer import _construct_model
from example.books.models import Author, Book
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_construct_model_foreign_key():
flavor = Flavor(name="first-flavor")
flavor.save()
parent = Flavor(name="parent-flavor")
... | parent.pk | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/utils/test_construct_model.py | test_construct_model_many_to_many | assert | complex_expr | 26 | import pytest
from django_unicorn.typer import _construct_model
from example.books.models import Author, Book
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_construct_model_many_to_many():
author = Author(name="author 1")
author.save()
book = Book(title="book 1", date_published="... | author.pk | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/action_parsers/utils/test_set_property_value.py | test_set_property_value_model | assert | complex_expr | 25 | from datetime import datetime
from typing import List
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.utils import set_property_value
from example.coffee.models import Flavor, Taste
def test_set_property_value_model():
component = FakeComponent(component_n... | model.name | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/utils/test_construct_model.py | test_construct_model_many_to_many | assert | complex_expr | 29 | import pytest
from django_unicorn.typer import _construct_model
from example.books.models import Author, Book
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_construct_model_many_to_many():
author = Author(name="author 1")
author.save()
book = Book(title="book 1", date_published="... | book.title | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_model_lifecycle.py | test_model | assert | complex_expr | 22 | import pytest
from django_unicorn.components import UnicornView
from django_unicorn.serializer import dumps, loads
from django_unicorn.typer import _construct_model
from django_unicorn.views.utils import set_property_from_data
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_model():
flavo... | flavor.name | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_model_lifecycle.py | test_model_foreign_key | assert | complex_expr | 26 | import pytest
from django_unicorn.components import UnicornView
from django_unicorn.serializer import dumps, loads
from django_unicorn.typer import _construct_model
from django_unicorn.views.utils import set_property_from_data
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_model_foreign_key(... | parent.name | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/utils/test_construct_model.py | test_construct_model_foreign_key | assert | complex_expr | 24 | import pytest
from django_unicorn.typer import _construct_model
from example.books.models import Author, Book
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_construct_model_foreign_key():
flavor = Flavor(name="first-flavor")
flavor.save()
parent = Flavor(name="parent-flavor")
... | flavor.name | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/utils/test_construct_model.py | test_construct_model_foreign_key | assert | complex_expr | 26 | import pytest
from django_unicorn.typer import _construct_model
from example.books.models import Author, Book
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_construct_model_foreign_key():
flavor = Flavor(name="first-flavor")
flavor.save()
parent = Flavor(name="parent-flavor")
... | parent.name | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/utils/test_construct_model.py | test_construct_model_many_to_many | assert | complex_expr | 27 | import pytest
from django_unicorn.typer import _construct_model
from example.books.models import Author, Book
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_construct_model_many_to_many():
author = Author(name="author 1")
author.save()
book = Book(title="book 1", date_published="... | author.name | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/management/commands/startunicorn/test_handle.py | test_handle_new_app | assert | complex_expr | 34 | import io
import os
import uuid
import pytest
from django.core.management.base import CommandError
from django_unicorn.management.commands.startunicorn import Command
def test_handle_new_app(settings, tmp_path, monkeypatch, capsys):
settings.BASE_DIR = tmp_path
# Reply "y" to create new app then "n" to star... | captured.out | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/action_parsers/call_method/test_call_method_name.py | test_call_method_name_arg_with_model_type_annotation_multiple | assert | complex_expr | 21 | from datetime import date, datetime, time, timedelta
from types import MappingProxyType
from typing import Optional, Union
from uuid import UUID, uuid4
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.call_method import _call_method_name
from example.coffee.mode... | flavor_two.pk | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/action_parsers/call_method/test_call_method_name.py | test_call_method_name_arg_with_model_type_annotation_multiple | assert | complex_expr | 27 | from datetime import date, datetime, time, timedelta
from types import MappingProxyType
from typing import Optional, Union
from uuid import UUID, uuid4
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.call_method import _call_method_name
from example.coffee.mode... | flavor_one.pk | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/test_process_component_request.py | test_html_entities_encoded | assert | complex_expr | 23 | from tests.views.message.utils import post_and_get_response
from django_unicorn.components import UnicornView
def test_html_entities_encoded(client):
data = {"hello": "test"}
action_queue = [
{
"payload": {"name": "hello", "value": "<b>test1</b>"},
"type": "syncInput",
... | response["dom"] | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/utils/test_set_property_from_data.py | test_set_property_from_data_list | assert | complex_expr | 30 | import sys
from datetime import datetime, timezone
from typing import List
import pytest
from django.db.models import Model, QuerySet
from django_unicorn.components import UnicornView
from django_unicorn.typing import QuerySetType
from django_unicorn.views.utils import set_property_from_data
from example.coffee.model... | component.array | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/action_parsers/utils/test_set_property_value.py | test_set_property_value_str | assert | complex_expr | 13 | from datetime import datetime
from typing import List
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.utils import set_property_value
from example.coffee.models import Flavor, Taste
def test_set_property_value_str():
component = FakeComponent(component_nam... | component.string | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/utils/test_set_property_from_data.py | test_set_property_from_data_str | assert | complex_expr | 23 | import sys
from datetime import datetime, timezone
from typing import List
import pytest
from django.db.models import Model, QuerySet
from django_unicorn.components import UnicornView
from django_unicorn.typing import QuerySetType
from django_unicorn.views.utils import set_property_from_data
from example.coffee.model... | component.string | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/action_parsers/utils/test_set_property_value.py | test_set_property_value_int | assert | complex_expr | 13 | from datetime import datetime
from typing import List
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.utils import set_property_value
from example.coffee.models import Flavor, Taste
def test_set_property_value_int():
component = FakeComponent(component_nam... | component.integer | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/utils/test_set_property_from_data.py | test_set_property_from_data_int | assert | complex_expr | 23 | import sys
from datetime import datetime, timezone
from typing import List
import pytest
from django.db.models import Model, QuerySet
from django_unicorn.components import UnicornView
from django_unicorn.typing import QuerySetType
from django_unicorn.views.utils import set_property_from_data
from example.coffee.model... | component.integer | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_cacher.py | test_caching_components | assert | complex_expr | 52 | from unittest.mock import MagicMock, patch
from django_unicorn.cacher import (
CacheableComponent,
cache_full_tree,
restore_from_cache,
)
from django_unicorn.components import UnicornView
def test_caching_components(settings):
settings.CACHES = {
"default": {
"BACKEND": "django.cor... | child.component_id | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/action_parsers/utils/test_set_property_value.py | test_set_property_value_datetime | assert | complex_expr | 13 | from datetime import datetime
from typing import List
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.utils import set_property_value
from example.coffee.models import Flavor, Taste
def test_set_property_value_datetime():
component = FakeComponent(componen... | component.datetime | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/test_unicorn_set_property_value.py | test_set_property_value_dataclass | assert | complex_expr | 12 | from dataclasses import dataclass
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.utils import set_property_value
from example.coffee.models import Flavor
def test_set_property_value_dataclass():
component = PropertyView(component_name="test", component_id... | component.inventory | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/utils/test_set_property_from_data.py | test_set_property_from_data_list_datetimes | assert | complex_expr | 23 | import sys
from datetime import datetime, timezone
from typing import List
import pytest
from django.db.models import Model, QuerySet
from django_unicorn.components import UnicornView
from django_unicorn.typing import QuerySetType
from django_unicorn.views.utils import set_property_from_data
from example.coffee.model... | component.datetimes | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/test_unicorn_model.py | test_set_property_from_data_model | assert | complex_expr | 10 | from django.db.models import Model
from django.db.models.fields import CharField
from django_unicorn.components import UnicornView
from django_unicorn.views.utils import set_property_from_data
def test_set_property_from_data_model():
component = ModelPropertyView(component_name="test", component_id="test_set_prop... | component.model.name | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_cacher.py | test_caching_components_with_template_html | assert_* | complex_expr | 29 | from unittest.mock import MagicMock, patch
from django_unicorn.cacher import (
CacheableComponent,
cache_full_tree,
restore_from_cache,
)
from django_unicorn.components import UnicornView
@patch("django_unicorn.cacher.create_template")
def test_caching_components_with_template_html(create_template):
c... | component.template_html) | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_cacher.py | test_caching_components | assert | complex_expr | 48 | from unittest.mock import MagicMock, patch
from django_unicorn.cacher import (
CacheableComponent,
cache_full_tree,
restore_from_cache,
)
from django_unicorn.components import UnicornView
def test_caching_components(settings):
settings.CACHES = {
"default": {
"BACKEND": "django.cor... | restored_root.component_id | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/test_unicorn_field.py | test_set_property_from_data_unicorn_field | assert | complex_expr | 7 | from django_unicorn.components import UnicornField, UnicornView
from django_unicorn.views.utils import set_property_from_data
def test_set_property_from_data_unicorn_field():
component = NestedPropertyView(component_name="test", component_id="test_set_property_from_data_unicorn_field")
assert "property_one" =... | component.property_one.name | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_call_method.py | test_message_call_method_return_value | assert | collection | 41 | import time
from typing import Dict, Optional
import orjson
import shortuuid
from tests.views.message.utils import post_and_get_response
from django_unicorn.components import UnicornView, unicorn_view
from django_unicorn.utils import generate_checksum
def _post_to_component(
client,
method_name: str,
com... | [] | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_call_method.py | test_message_call_method_return_value | assert | collection | 42 | import time
from typing import Dict, Optional
import orjson
import shortuuid
from tests.views.message.utils import post_and_get_response
from django_unicorn.components import UnicornView, unicorn_view
from django_unicorn.utils import generate_checksum
def _post_to_component(
client,
method_name: str,
com... | {} | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/utils/test_set_property_from_data.py | test_set_property_from_data_list | assert | collection | 26 | import sys
from datetime import datetime, timezone
from typing import List
import pytest
from django.db.models import Model, QuerySet
from django_unicorn.components import UnicornView
from django_unicorn.typing import QuerySetType
from django_unicorn.views.utils import set_property_from_data
from example.coffee.model... | [] | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_typer.py | test_cast_value_model_dict | assert | collection | 20 | import datetime
from dataclasses import dataclass
from typing import List, Optional
from typing import get_type_hints as typing_get_type_hints
from pydantic import BaseModel
from django_unicorn.components import UnicornView
from django_unicorn.typer import cast_attribute_value, cast_value, get_type_hints
from example... | {"id": 1} | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/action_parsers/utils/test_set_property_value.py | test_set_property_value_many_to_many_is_referenced | assert | collection | 32 | from datetime import datetime
from typing import List
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.utils import set_property_value
from example.coffee.models import Flavor, Taste
@pytest.mark.django_db
def test_set_property_value_many_to_many_is_referenced(... | [taste.pk] | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_typer.py | test_cast_value_list_dataclass | assert | collection | 20 | import datetime
from dataclasses import dataclass
from typing import List, Optional
from typing import get_type_hints as typing_get_type_hints
from pydantic import BaseModel
from django_unicorn.components import UnicornView
from django_unicorn.typer import cast_attribute_value, cast_value, get_type_hints
from example... | [test_data] | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/action_parsers/utils/test_set_property_value.py | test_set_property_value_many_to_many_references_model | assert | collection | 34 | from datetime import datetime
from typing import List
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.utils import set_property_value
from example.coffee.models import Flavor, Taste
@pytest.mark.django_db
def test_set_property_value_many_to_many_references_mod... | [flavor.pk] | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/templatetags/test_unicorn.py | test_unicorn_kwargs | assert | collection | 10 | from django.template.base import Parser, Token, TokenType
from django_unicorn.templatetags.unicorn import unicorn
def test_unicorn_kwargs():
token = Token(TokenType.TEXT, "unicorn 'todo' blob='blob'")
unicorn_node = unicorn(Parser([]), token)
assert unicorn_node.kwargs == | {"blob": "blob"} | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_sync_input.py | test_message_nested_sync_input | assert | collection | 20 | from tests.views.message.utils import post_and_get_response
def test_message_nested_sync_input(client):
data = {"dictionary": {"name": "test"}}
action_queue = [
{
"payload": {"name": "dictionary.name", "value": "test1"},
"type": "syncInput",
}
]
response = post_a... | {"name": "test1"} | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_settings.py | test_get_morpher_settings | assert | collection | 13 | import pytest
from django_unicorn.settings import (
get_cache_alias,
get_minify_html_enabled,
get_morpher_settings,
get_script_location,
get_serial_enabled,
)
def test_get_morpher_settings(settings):
assert get_morpher_settings() == | {"NAME": "morphdom"} | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/templatetags/test_unicorn.py | test_unicorn_args_and_kwargs | assert | collection | 11 | from django.template.base import Parser, Token, TokenType
from django_unicorn.templatetags.unicorn import unicorn
def test_unicorn_args_and_kwargs():
# args after the component name get ignored
token = Token(TokenType.TEXT, "unicorn 'todo' '1' 2 hello='world' test=3 '4'")
unicorn_node = unicorn(Parser([])... | {"hello": "world", "test": 3} | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_calls.py | test_message_calls | assert | collection | 17 | from tests.views.message.utils import post_and_get_response
from django_unicorn.components import UnicornView
def test_message_calls(client):
action_queue = [
{
"payload": {"name": "test_call"},
"type": "callMethod",
"target": None,
}
]
response = post_... | [{"args": [], "fn": "testCall"}] | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_hash.py | test_message_hash_no_change_but_calls | assert | collection | 36 | import shortuuid
from tests.views.fake_components import FakeComponent
from tests.views.message.test_calls import FakeCallsComponent
from tests.views.message.utils import post_and_get_response
from django_unicorn.components import UnicornView
from django_unicorn.utils import generate_checksum
def test_message_hash_no... | [{"args": [], "fn": "testCall"}] | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_calls.py | test_message_calls_with_arg | assert | collection | 17 | from tests.views.message.utils import post_and_get_response
from django_unicorn.components import UnicornView
def test_message_calls_with_arg(client):
action_queue = [
{
"payload": {"name": "test_call3"},
"type": "callMethod",
"target": None,
}
]
respon... | [{"args": ["hello"], "fn": "testCall3"}] | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_call_method_multiple.py | test_message_multiple | assert | func_call | 63 | import time
from copy import deepcopy
from multiprocessing.dummy import Pool as ThreadPool
import orjson
import pytest
import shortuuid
from django_unicorn.components import UnicornView
from django_unicorn.utils import generate_checksum
def _set_serial(
settings,
enabled,
timeout,
cache_backend="djan... | len(results) | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_type_hints.py | assert_decimal | assert | func_call | 24 | from dataclasses import dataclass
from decimal import Decimal
from tests.views.message.utils import post_and_get_response
from django_unicorn.components import UnicornView
class FakeObjectsComponent(UnicornView):
template_name = "templates/test_component.html"
decimal_example: Decimal = Decimal(1.1)
flo... | Decimal(1.5) | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_call_method_multiple.py | test_message_two | assert | func_call | 59 | import time
from copy import deepcopy
from multiprocessing.dummy import Pool as ThreadPool
import orjson
import pytest
import shortuuid
from django_unicorn.components import UnicornView
from django_unicorn.utils import generate_checksum
def _set_serial(
settings,
enabled,
timeout,
cache_backend="djan... | len(messages) | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_model_lifecycle.py | test_queryset | assert | func_call | 26 | import pytest
from django_unicorn.components import UnicornView
from django_unicorn.serializer import dumps, loads
from django_unicorn.typer import _construct_model
from django_unicorn.views.utils import set_property_from_data
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_queryset():
te... | str(flavor.uuid) | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/action_parsers/call_method/test_call_method_name.py | test_call_method_name_with_date_as_epoch_type_hint | assert | func_call | 33 | from datetime import date, datetime, time, timedelta
from types import MappingProxyType
from typing import Optional, Union
from uuid import UUID, uuid4
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.call_method import _call_method_name
from example.coffee.mode... | date(2023, 8, 8) | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_target.py | test_message_generated_checksum_matches_dom_checksum | assert | func_call | 43 | import time
import shortuuid
from bs4 import BeautifulSoup
from django_unicorn.components import UnicornView
from django_unicorn.utils import generate_checksum
def test_message_generated_checksum_matches_dom_checksum(client):
data = {"clicked": False}
message = {
"actionQueue": [
{
... | body.get("checksum") | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_cacher.py | test_caching_components | assert | func_call | 49 | from unittest.mock import MagicMock, patch
from django_unicorn.cacher import (
CacheableComponent,
cache_full_tree,
restore_from_cache,
)
from django_unicorn.components import UnicornView
def test_caching_components(settings):
settings.CACHES = {
"default": {
"BACKEND": "django.cor... | len(restored_root.children) | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/message/test_type_hints.py | assert_dataclass | assert | func_call | 27 | from dataclasses import dataclass
from decimal import Decimal
from tests.views.message.utils import post_and_get_response
from django_unicorn.components import UnicornView
class FakeObjectsComponent(UnicornView):
template_name = "templates/test_component.html"
decimal_example: Decimal = Decimal(1.1)
flo... | ExampleDataclass(hello="world") | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/views/test_unicorn_dict.py | test_set_property_from_data_dict | assert | func_call | 7 | from django_unicorn.components import UnicornView
from django_unicorn.views.utils import set_property_from_data
def test_set_property_from_data_dict():
component = DictPropertyView(component_name="test", component_id="test_set_property_from_data_dict")
assert "dictionary" == | component.dictionary.get("name") | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-commons/django-unicorn | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | train | train | tests/test_cacher.py | test_caching_components | assert | func_call | 54 | from unittest.mock import MagicMock, patch
from django_unicorn.cacher import (
CacheableComponent,
cache_full_tree,
restore_from_cache,
)
from django_unicorn.components import UnicornView
def test_caching_components(settings):
settings.CACHES = {
"default": {
"BACKEND": "django.cor... | len(restored_root.children[0].children) | 04be090fec6234f5501f47f1c4661beb454db861 | 139 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_dynamic_api.py | test_formhelper__delitem__and__len__ | assert | numeric_literal | 19 | import pytest
from django import forms
from crispy_forms.bootstrap import AppendedText
from crispy_forms.exceptions import DynamicError
from crispy_forms.helper import FormHelper, FormHelpersException
from crispy_forms.layout import HTML, Div, Field, Fieldset, Layout, MultiField
from crispy_forms.tests.forms import S... | 1 | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_dynamic_api.py | test_wrap_all_fields | assert | string_literal | 24 | import pytest
from django import forms
from crispy_forms.bootstrap import AppendedText
from crispy_forms.exceptions import DynamicError
from crispy_forms.helper import FormHelper, FormHelpersException
from crispy_forms.layout import HTML, Div, Field, Fieldset, Layout, MultiField
from crispy_forms.tests.forms import S... | "email" | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_dynamic_api.py | test_formhelper__getitem__ | assert | string_literal | 30 | import pytest
from django import forms
from crispy_forms.bootstrap import AppendedText
from crispy_forms.exceptions import DynamicError
from crispy_forms.helper import FormHelper, FormHelpersException
from crispy_forms.layout import HTML, Div, Field, Fieldset, Layout, MultiField
from crispy_forms.tests.forms import S... | "extra" | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_dynamic_api.py | test_wrap_selected_fields | assert | string_literal | 26 | import pytest
from django import forms
from crispy_forms.bootstrap import AppendedText
from crispy_forms.exceptions import DynamicError
from crispy_forms.helper import FormHelper, FormHelpersException
from crispy_forms.layout import HTML, Div, Field, Fieldset, Layout, MultiField
from crispy_forms.tests.forms import S... | "legend" | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_dynamic_api.py | test_formhelper__setitem__ | assert | string_literal | 19 | import pytest
from django import forms
from crispy_forms.bootstrap import AppendedText
from crispy_forms.exceptions import DynamicError
from crispy_forms.helper import FormHelper, FormHelpersException
from crispy_forms.layout import HTML, Div, Field, Fieldset, Layout, MultiField
from crispy_forms.tests.forms import S... | "replaced" | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_dynamic_api.py | test_wrap_all_fields | assert | string_literal | 25 | import pytest
from django import forms
from crispy_forms.bootstrap import AppendedText
from crispy_forms.exceptions import DynamicError
from crispy_forms.helper import FormHelper, FormHelpersException
from crispy_forms.layout import HTML, Div, Field, Fieldset, Layout, MultiField
from crispy_forms.tests.forms import S... | "password1" | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_dynamic_api.py | test_wrap_all_fields | assert | string_literal | 26 | import pytest
from django import forms
from crispy_forms.bootstrap import AppendedText
from crispy_forms.exceptions import DynamicError
from crispy_forms.helper import FormHelper, FormHelpersException
from crispy_forms.layout import HTML, Div, Field, Fieldset, Layout, MultiField
from crispy_forms.tests.forms import S... | "password2" | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_form_helper.py | test_inputs | assert | numeric_literal | 55 | import re
import pytest
import django
from django import forms
from django.forms.models import formset_factory
from django.middleware.csrf import _get_new_csrf_string
from django.template import Context, Template, TemplateSyntaxError
from django.test.html import parse_html
from django.urls import reverse
from django.... | 9 | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_form_helper.py | test_inputs | assert | numeric_literal | 57 | import re
import pytest
import django
from django import forms
from django.forms.models import formset_factory
from django.middleware.csrf import _get_new_csrf_string
from django.template import Context, Template, TemplateSyntaxError
from django.test.html import parse_html
from django.urls import reverse
from django.... | 8 | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_form_helper.py | test_form_with_helper_without_layout | assert | numeric_literal | 46 | import re
import pytest
import django
from django import forms
from django.forms.models import formset_factory
from django.middleware.csrf import _get_new_csrf_string
from django.template import Context, Template, TemplateSyntaxError
from django.test.html import parse_html
from django.urls import reverse
from django.... | 1 | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_form_helper.py | test_render_unmentioned_fields_order | assert | numeric_literal | 31 | import re
import pytest
import django
from django import forms
from django.forms.models import formset_factory
from django.middleware.csrf import _get_new_csrf_string
from django.template import Context, Template, TemplateSyntaxError
from django.test.html import parse_html
from django.urls import reverse
from django.... | 4 | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_form_helper.py | test_render_hidden_fields | assert | numeric_literal | 40 | import re
import pytest
import django
from django import forms
from django.forms.models import formset_factory
from django.middleware.csrf import _get_new_csrf_string
from django.template import Context, Template, TemplateSyntaxError
from django.test.html import parse_html
from django.urls import reverse
from django.... | 3 | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_form_helper.py | test_render_hidden_fields | assert | numeric_literal | 41 | import re
import pytest
import django
from django import forms
from django.forms.models import formset_factory
from django.middleware.csrf import _get_new_csrf_string
from django.template import Context, Template, TemplateSyntaxError
from django.test.html import parse_html
from django.urls import reverse
from django.... | 2 | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_form_helper.py | test_render_required_fields | assert | numeric_literal | 31 | import re
import pytest
import django
from django import forms
from django.forms.models import formset_factory
from django.middleware.csrf import _get_new_csrf_string
from django.template import Context, Template, TemplateSyntaxError
from django.test.html import parse_html
from django.urls import reverse
from django.... | 7 | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_form_helper.py | test_form_show_errors | assert | numeric_literal | 51 | import re
import pytest
import django
from django import forms
from django.forms.models import formset_factory
from django.middleware.csrf import _get_new_csrf_string
from django.template import Context, Template, TemplateSyntaxError
from django.test.html import parse_html
from django.urls import reverse
from django.... | 0 | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_form_helper.py | test_bootstrap_form_show_errors_bs3 | assert | numeric_literal | 47 | import re
import pytest
import django
from django import forms
from django.forms.models import formset_factory
from django.middleware.csrf import _get_new_csrf_string
from django.template import Context, Template, TemplateSyntaxError
from django.test.html import parse_html
from django.urls import reverse
from django.... | 6 | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_layout.py | test_context_pollution | assert | numeric_literal | 51 | import pytest
from django import forms
from django.forms.models import formset_factory, modelformset_factory
from django.middleware.csrf import _get_new_csrf_string
from django.shortcuts import render
from django.template import Context, Template
from django.urls import reverse
from django.utils.translation import get... | 2 | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_layout.py | test_context_pollution | assert | numeric_literal | 52 | import pytest
from django import forms
from django.forms.models import formset_factory, modelformset_factory
from django.middleware.csrf import _get_new_csrf_string
from django.shortcuts import render
from django.template import Context, Template
from django.urls import reverse
from django.utils.translation import get... | 1 | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_layout.py | test_layout_fieldset_row_html_with_unicode_fieldnames | assert | numeric_literal | 80 | import pytest
from django import forms
from django.forms.models import formset_factory, modelformset_factory
from django.middleware.csrf import _get_new_csrf_string
from django.shortcuts import render
from django.template import Context, Template
from django.urls import reverse
from django.utils.translation import get... | 6 | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
django-crispy-forms/django-crispy-forms | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | train | train | crispy_forms/tests/test_layout.py | test_formset_layout | assert | numeric_literal | 65 | import pytest
from django import forms
from django.forms.models import formset_factory, modelformset_factory
from django.middleware.csrf import _get_new_csrf_string
from django.shortcuts import render
from django.template import Context, Template
from django.urls import reverse
from django.utils.translation import get... | 5 | 7a632378a8b0d27f61a18207acdf8fa05268aeb1 | 170 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.