text stringlengths 0 1.05M | meta dict |
|---|---|
from django.test import TestCase
from sendinel.backend.models import WayOfCommunication, \
get_enabled_wocs, \
get_immediate_wocs, \
get_woc
class WayOfCommunicationTest(TestCase):
fixtures = ["backend_te... | {
"repo_name": "Sendinel/Sendinel",
"path": "sendinel/backend/tests/way_of_communication_test.py",
"copies": "1",
"size": "1261",
"license": "mit",
"hash": 6713901027772013000,
"line_mean": 35.0571428571,
"line_max": 79,
"alpha_frac": 0.5931800159,
"autogenerated": false,
"ratio": 3.76417910447761... |
from django.test import TestCase
from shanghai.apps import Shanghai
from tests.fixtures.resources import ArticleResource, CategoryResource
class InspectorTestCase(TestCase):
def __init__(self, methodName='runTest'):
super(InspectorTestCase, self).__init__(methodName=methodName)
self.api = None
... | {
"repo_name": "bobisjan/django-shanghai",
"path": "tests/unit/inspection.py",
"copies": "1",
"size": "2379",
"license": "mit",
"hash": -3052068207677166600,
"line_mean": 33.4782608696,
"line_max": 75,
"alpha_frac": 0.6822194199,
"autogenerated": false,
"ratio": 4.195767195767195,
"config_test":... |
from django.test import TestCase
from shorturl import baseconv
class BaseRangeTests(TestCase):
def setUp(self):
self.range = baseconv.BaseRange("a-z")
def test_base_range_repr(self):
self.assertEqual(repr(self.range), "<BaseRange:a-z>")
def test_base_range_first_ord(self):
s... | {
"repo_name": "vbmendes/django-meio-shorturl",
"path": "src/shorturl/tests/test_baseconv.py",
"copies": "1",
"size": "3132",
"license": "bsd-3-clause",
"hash": 3332419453056939500,
"line_mean": 29.1153846154,
"line_max": 67,
"alpha_frac": 0.6583652618,
"autogenerated": false,
"ratio": 3.360515021... |
from django.test import TestCase
from sims.models import LogEntry, Pipeline
class PipelineTestCase(TestCase):
def setUp(self):
self.pipeline, pipeline_created = Pipeline.objects.get_or_create(name="test", version="0.1")
self.sample_name = "NA18507"
self.rule = self.sample_name + ".data.tx... | {
"repo_name": "huddlej/django_sims",
"path": "sims/tests.py",
"copies": "1",
"size": "1391",
"license": "mit",
"hash": -1441946091286127400,
"line_mean": 37.6388888889,
"line_max": 126,
"alpha_frac": 0.6506110712,
"autogenerated": false,
"ratio": 3.7292225201072386,
"config_test": true,
"has_... |
from django.test import TestCase
from sqlreports.models import SQLReport, SQLReportParam
FIXTURES = ['initial_data']
class BaseTestCase(TestCase):
def login(self, username, password):
'''
Login method which logs in django test client
'''
self.client.login(username=username, passw... | {
"repo_name": "hashedin/django-sql-reports",
"path": "sqlreports/tests/test_reports.py",
"copies": "1",
"size": "1503",
"license": "mit",
"hash": -5652705531667784000,
"line_mean": 29.6734693878,
"line_max": 104,
"alpha_frac": 0.5848303393,
"autogenerated": false,
"ratio": 3.997340425531915,
"c... |
from django.test import TestCase
from store.forms import ReviewForm
from store.models import Review
from .factories import *
class ReviewFormTest(TestCase):
def test_form_validation_for_blank_items(self):
p1 = ProductFactory.create()
form = ReviewForm(
data={'name':'', 'text': '', '... | {
"repo_name": "kevgathuku/compshop",
"path": "store/tests/test_forms.py",
"copies": "2",
"size": "1654",
"license": "bsd-3-clause",
"hash": 5145341513211773000,
"line_mean": 33.4583333333,
"line_max": 84,
"alpha_frac": 0.6257557437,
"autogenerated": false,
"ratio": 3.8375870069605567,
"config_t... |
from django.test import TestCase
from storelocator.forms import StoreLocatorForm
class StoreLocatorFormTest(TestCase):
def test_form_empty_invalid(self):
form = StoreLocatorForm({})
valid = form.is_valid()
self.assertEqual(1, len(form.errors))
self.assertTrue(form.non_field_error... | {
"repo_name": "moccu/django-storelocator",
"path": "storelocator/tests/test_forms.py",
"copies": "1",
"size": "2495",
"license": "mit",
"hash": -617857268049063000,
"line_mean": 28.011627907,
"line_max": 69,
"alpha_frac": 0.5486973948,
"autogenerated": false,
"ratio": 3.9229559748427674,
"confi... |
from django.test import TestCase
from storelocator.importers import locations, shops
from storelocator.factories import StoreLocatorFactory
from storelocator.models import Location, Shop
import os
class LocationImportTest(TestCase):
def setUp(self):
self.csv = os.path.abspath(os.path.join(
... | {
"repo_name": "moccu/django-storelocator",
"path": "storelocator/tests/test_importers.py",
"copies": "1",
"size": "1279",
"license": "mit",
"hash": 6544705613707779000,
"line_mean": 32.6578947368,
"line_max": 72,
"alpha_frac": 0.6684910086,
"autogenerated": false,
"ratio": 3.86404833836858,
"co... |
from django.test import TestCase
from suggestionbox import models
class CommentTests(TestCase):
def test_descendant_count(self):
kwargs = {'title': 'Title', 'description': 'Description'}
top = models.Comment(**kwargs)
top.save()
unrelated = models.Comment(**kwargs)
unrela... | {
"repo_name": "sorenh/python-django-suggestionbox",
"path": "suggestionbox/tests.py",
"copies": "1",
"size": "1134",
"license": "apache-2.0",
"hash": 2196792014486215700,
"line_mean": 28.8421052632,
"line_max": 65,
"alpha_frac": 0.5864197531,
"autogenerated": false,
"ratio": 3.1153846153846154,
... |
from django.test import TestCase
from systems.tests.utils import create_fake_host
from systems.models import System
from core.search.compiler.django_compile import compile_to_django
from core.search.compiler.invschema import discover_all
class SystemTests(TestCase):
def setUp(self):
System.objects.all().... | {
"repo_name": "mozilla/inventory",
"path": "core/search/tests/test_system_search.py",
"copies": "2",
"size": "2777",
"license": "bsd-3-clause",
"hash": -864395093368206500,
"line_mean": 34.6025641026,
"line_max": 79,
"alpha_frac": 0.620453727,
"autogenerated": false,
"ratio": 3.649145860709593,
... |
from django.test import TestCase
from tastypie.contrib.contenttypes.fields import GenericForeignKeyField
from content_gfk.models import Note, Quote, Definition
from content_gfk.api.resources import NoteResource, QuoteResource
class ContentTypeFieldTestCase(TestCase):
def test_init(self):
# Test that yo... | {
"repo_name": "cbxcube/bezrealitky.py",
"path": "tests/content_gfk/tests/fields.py",
"copies": "16",
"size": "2692",
"license": "bsd-3-clause",
"hash": 5043962102352259000,
"line_mean": 31.4337349398,
"line_max": 89,
"alpha_frac": 0.6092124814,
"autogenerated": false,
"ratio": 4.246056782334385,
... |
from django.test import TestCase
from ..templatetags import explorer
class HighlightTestCase(TestCase):
def test_highlight_returns_text_when_empty_word(self):
expected = 'foo bar baz'
assert explorer.highlight('foo bar baz', '') == expected
def test_highlight(self):
expected = '<s... | {
"repo_name": "Candihub/pixel",
"path": "apps/explorer/tests/test_templatetags.py",
"copies": "1",
"size": "1949",
"license": "bsd-3-clause",
"hash": -3058537827487708000,
"line_mean": 27.2463768116,
"line_max": 75,
"alpha_frac": 0.6100564392,
"autogenerated": false,
"ratio": 3.921529175050302,
... |
from django.test import TestCase
from tenancy.filters import *
from tenancy.models import Tenant, TenantGroup
class TenantGroupTestCase(TestCase):
queryset = TenantGroup.objects.all()
filterset = TenantGroupFilterSet
@classmethod
def setUpTestData(cls):
parent_tenant_groups = (
... | {
"repo_name": "digitalocean/netbox",
"path": "netbox/tenancy/tests/test_filters.py",
"copies": "1",
"size": "3818",
"license": "apache-2.0",
"hash": -4076521981996918300,
"line_mean": 40.0537634409,
"line_max": 119,
"alpha_frac": 0.6257202724,
"autogenerated": false,
"ratio": 3.5450324976787373,
... |
from django.test import TestCase
from test_generator.core import TestSingleObjectMixin, TestModelStringMixin
from test_generator.viewsets import TestModelViewsetMixin, TestReadOnlyModelViewsetMixin, TestViewsetMixin
from rdmo.accounts.utils import set_group_permissions
from rdmo.questions.models import Catalog, Quest... | {
"repo_name": "DMPwerkzeug/DMPwerkzeug",
"path": "rdmo/projects/tests/test_viewsets.py",
"copies": "1",
"size": "10032",
"license": "apache-2.0",
"hash": -5854870148636656000,
"line_mean": 33.5931034483,
"line_max": 112,
"alpha_frac": 0.5514354067,
"autogenerated": false,
"ratio": 3.6573095151294... |
from django.test import TestCase
from test_generator.viewsets import TestModelViewsetMixin
from daiquiri.core.utils import setup_group
from ..models import Schema, Table, Column, Function
class MetadataViewsetTestCase(TestCase):
databases = ('default', 'data', 'tap', 'oai')
fixtures = (
'auth.jso... | {
"repo_name": "aipescience/django-daiquiri",
"path": "daiquiri/metadata/tests/test_viewsets.py",
"copies": "1",
"size": "5064",
"license": "apache-2.0",
"hash": 3547649935430461000,
"line_mean": 33.924137931,
"line_max": 95,
"alpha_frac": 0.5819510269,
"autogenerated": false,
"ratio": 3.796101949... |
from django.test import TestCase
from test_generator.viewsets import TestModelViewsetMixin
from rdmo.accounts.utils import set_group_permissions
from ..models import Attribute
class DomainViewsetTestCase(TestCase):
fixtures = (
'users.json',
'groups.json',
'accounts.json',
'dom... | {
"repo_name": "DMPwerkzeug/DMPwerkzeug",
"path": "rdmo/domain/tests/test_viewsets.py",
"copies": "1",
"size": "1949",
"license": "apache-2.0",
"hash": -3056622785885710000,
"line_mean": 27.6617647059,
"line_max": 101,
"alpha_frac": 0.5654181632,
"autogenerated": false,
"ratio": 3.8902195608782435... |
from django.test import TestCase
from test_generator.viewsets import TestModelViewsetMixin
from rdmo.core.testing.mixins import TestTranslationMixin
from rdmo.accounts.utils import set_group_permissions
from ..models import View
class ViewsViewsetTestCase(TestCase):
fixtures = (
'users.json',
... | {
"repo_name": "DMPwerkzeug/DMPwerkzeug",
"path": "rdmo/views/tests/test_viewsets.py",
"copies": "1",
"size": "1816",
"license": "apache-2.0",
"hash": -7648265892846689000,
"line_mean": 25.3188405797,
"line_max": 90,
"alpha_frac": 0.5539647577,
"autogenerated": false,
"ratio": 3.7520661157024793,
... |
from django.test import TestCase
from test_generator.views import TestListViewMixin
from rdmo.core.testing.mixins import TestExportViewMixin, TestImportViewMixin
from rdmo.accounts.utils import set_group_permissions
class TasksViewTestCase(TestCase):
fixtures = (
'users.json',
'groups.json',
... | {
"repo_name": "DMPwerkzeug/DMPwerkzeug",
"path": "rdmo/tasks/tests/test_views.py",
"copies": "1",
"size": "1351",
"license": "apache-2.0",
"hash": 2870309396828035600,
"line_mean": 24.0185185185,
"line_max": 97,
"alpha_frac": 0.562546262,
"autogenerated": false,
"ratio": 3.7737430167597767,
"co... |
from django.test import TestCase
from test_generator.views import TestViewMixin
class FilesViewTestCase(TestCase):
fixtures = (
'auth.json',
'files.json'
)
users = (
('admin', 'admin'),
('manager', 'manager'),
('user', 'user'),
('anonymous', None),
)
... | {
"repo_name": "aipescience/django-daiquiri",
"path": "daiquiri/files/tests/test_views.py",
"copies": "1",
"size": "1513",
"license": "apache-2.0",
"hash": 559704374450386500,
"line_mean": 24.2166666667,
"line_max": 75,
"alpha_frac": 0.4943820225,
"autogenerated": false,
"ratio": 3.438636363636363... |
from django.test import TestCase
from test_generator.views import TestViewMixin, TestListViewMixin
from daiquiri.core.utils import setup_group
class ContactViewTestCase(TestCase):
fixtures = (
'auth.json',
'contact.json'
)
users = (
('admin', 'admin'),
('manager', 'mana... | {
"repo_name": "aipescience/django-daiquiri",
"path": "daiquiri/contact/tests/test_views.py",
"copies": "1",
"size": "2388",
"license": "apache-2.0",
"hash": -5270294213550285000,
"line_mean": 32.6338028169,
"line_max": 618,
"alpha_frac": 0.6201842546,
"autogenerated": false,
"ratio": 3.3445378151... |
from django.test import TestCase
from test_generator.views import TestViewMixin, TestListViewMixin
from daiquiri.core.utils import setup_group
class MetadataViewTestCase(TestViewMixin, TestCase):
databases = ('default', 'data', 'tap', 'oai')
fixtures = (
'auth.json',
'metadata.json'
)
... | {
"repo_name": "aipescience/django-daiquiri",
"path": "daiquiri/metadata/tests/test_views.py",
"copies": "1",
"size": "3340",
"license": "apache-2.0",
"hash": -5134687704544602000,
"line_mean": 21.2666666667,
"line_max": 84,
"alpha_frac": 0.5380239521,
"autogenerated": false,
"ratio": 3.5569755058... |
from django.test import TestCase
from .testing_core import generate_test_user
from .REST_serializers import (PublicGroupSerializer,
PublicUserSerializer,
PrivateGroupSerializer,
GroupMetaUpdateSerializer,
... | {
"repo_name": "PUNCH-Cyber/YaraGuardian",
"path": "core/test_REST_serializers.py",
"copies": "1",
"size": "4371",
"license": "apache-2.0",
"hash": 7861981437608516000,
"line_mean": 37.0086956522,
"line_max": 112,
"alpha_frac": 0.5394646534,
"autogenerated": false,
"ratio": 5.228468899521531,
"c... |
from django.test import TestCase
from testing_utils import AccountUserTestingMixin
class AccountModelsTest(TestCase, AccountUserTestingMixin):
"""
Verify that the objects are created as intended, and that the managers
return querysets as intended.
"""
def setUp(self):
from django.contrib.... | {
"repo_name": "aptivate/django-organizations",
"path": "tests/tests/models.py",
"copies": "1",
"size": "7584",
"license": "bsd-2-clause",
"hash": 2478755827901208600,
"line_mean": 41.3687150838,
"line_max": 78,
"alpha_frac": 0.6584915612,
"autogenerated": false,
"ratio": 4.476977567886659,
"con... |
from django.test import TestCase
from tests.testapp.models import Author
class CaseExactTests(TestCase):
def test_charfield(self):
dickie = Author.objects.create(name="Dickens")
authors = Author.objects.filter(name__case_exact="dickens")
assert list(authors) == []
authors = Auth... | {
"repo_name": "arnau126/django-mysql",
"path": "tests/testapp/test_lookups.py",
"copies": "2",
"size": "1875",
"license": "bsd-3-clause",
"hash": 8316283246026565000,
"line_mean": 33.0909090909,
"line_max": 76,
"alpha_frac": 0.6410666667,
"autogenerated": false,
"ratio": 3.5850860420650097,
"co... |
from django.test import TestCase
from tests.utils import TestConfiguration
from core.models import Job
class RecordGroupModelTestCase(TestCase):
def setUp(self) -> None:
self.config = TestConfiguration()
def test_all_jobs(self):
Job.objects.create(record_group=self.config.record_group,
... | {
"repo_name": "WSULib/combine",
"path": "tests/test_models/test_record_group.py",
"copies": "1",
"size": "1555",
"license": "mit",
"hash": 8340248478729002000,
"line_mean": 37.9,
"line_max": 75,
"alpha_frac": 0.6263665595,
"autogenerated": false,
"ratio": 3.746987951807229,
"config_test": true,... |
from django.test import TestCase
from tidbits.utils.parser import MetaTagParser
import requests
class MetaTagParserTestCase(TestCase):
def setUp(self):
# FIXME: Should refactor with Mock.
# Tests with a article published on PPSS.
response = requests.get("http://ppss.kr/archives/55616")... | {
"repo_name": "dobestan/superpun.ch",
"path": "superpunch/tidbits/tests/utils/test_parser.py",
"copies": "1",
"size": "1376",
"license": "mit",
"hash": 7545905888989397000,
"line_mean": 25.2745098039,
"line_max": 71,
"alpha_frac": 0.6052238806,
"autogenerated": false,
"ratio": 3.6021505376344085,... |
from django.test import TestCase
from tidings.models import Watch
from tidings.tasks import claim_watches
from .base import watch, user
class ClaimWatchesTests(TestCase):
def test_none(self):
"""No anonymous watches to claim."""
u = user(email='some@bo.dy', save=True)
claim_watches(u)
... | {
"repo_name": "mozilla/django-tidings",
"path": "tests/test_tasks.py",
"copies": "1",
"size": "1859",
"license": "bsd-3-clause",
"hash": -2353187690465962000,
"line_mean": 32.8,
"line_max": 71,
"alpha_frac": 0.6325981711,
"autogenerated": false,
"ratio": 3.718,
"config_test": true,
"has_no_ke... |
from django.test import TestCase
from tribes.models import Tribe
class TribesTest(TestCase):
fixtures = ["tribes_auth.json"]
def test_unauth_create_get(self):
"""can an unauth'd user get to page?"""
response = self.client.get("/tribes/create/")
self.assertEqual(response.s... | {
"repo_name": "alex/pinax",
"path": "pinax/apps/tribes/tests/__init__.py",
"copies": "1",
"size": "2486",
"license": "mit",
"hash": 8548009001299738000,
"line_mean": 41.8620689655,
"line_max": 103,
"alpha_frac": 0.6142397426,
"autogenerated": false,
"ratio": 3.9397781299524564,
"config_test": t... |
from django.test import TestCase
from tsdata.utils import GroupedData
class GrouperTestCase(TestCase):
def test_single_item_group(self):
"""Verify group by with single item"""
stops = GroupedData(by='year')
stops.add(year=2010, race1=10)
stops.add(year=2010, race2=10)
stop... | {
"repo_name": "OpenDataPolicingNC/Traffic-Stops",
"path": "nc/tests/test_grouper.py",
"copies": "1",
"size": "1562",
"license": "mit",
"hash": -1094918771822700300,
"line_mean": 42.3888888889,
"line_max": 86,
"alpha_frac": 0.5845070423,
"autogenerated": false,
"ratio": 3.4481236203090506,
"conf... |
from django.test import TestCase
from userena.models import UserenaSignup
from userena import settings as userena_settings
from userena.utils import get_user_model
import datetime, re
User = get_user_model()
class UserenaManagerTests(TestCase):
""" Test the manager of Userena """
user_info = {'username': '... | {
"repo_name": "botify-labs/django-userena",
"path": "userena/tests/tests_managers.py",
"copies": "1",
"size": "5913",
"license": "bsd-3-clause",
"hash": -8578624614099633000,
"line_mean": 34.8424242424,
"line_max": 109,
"alpha_frac": 0.6502621343,
"autogenerated": false,
"ratio": 3.93675099866844... |
from django.test import TestCase
from user.models import User
from user.forms import UpdatePasswordForm
class TestUpdateUserForm(TestCase):
def setUp(self):
self.old_password_valid = '1234567'
self.old_password_invalid = '12345699'
self.password_valid = '123456789'
self.password_... | {
"repo_name": "fga-gpp-mds/2017.2-Receituario-Medico",
"path": "medical_prescription/user/test/test_form_edit_password.py",
"copies": "1",
"size": "2661",
"license": "mit",
"hash": 6406919440452467000,
"line_mean": 40.578125,
"line_max": 80,
"alpha_frac": 0.6042841037,
"autogenerated": false,
"ra... |
from django.test import TestCase
from user.models import User
from user.forms import UserLoginForm
class TestUserForm(TestCase):
def setUp(self):
self.email_valid_reset = 'admin@gmail.com'
self.email_valid = 'admin@admin.com'
self.email_invalid = 'admin.com'
self.email_invalid_1 ... | {
"repo_name": "fga-gpp-mds/2017.2-Receituario-Medico",
"path": "medical_prescription/user/test/test_form_user_login.py",
"copies": "1",
"size": "2174",
"license": "mit",
"hash": -227433566386847170,
"line_mean": 33.5079365079,
"line_max": 60,
"alpha_frac": 0.6057957682,
"autogenerated": false,
"r... |
from django.test import TestCase
from utilities.utils import deepmerge, dict_to_filter_params
class DictToFilterParamsTest(TestCase):
"""
Validate the operation of dict_to_filter_params().
"""
def setUp(self):
return
def test_dict_to_filter_params(self):
input = {
'a... | {
"repo_name": "lampwins/netbox",
"path": "netbox/utilities/tests/test_utils.py",
"copies": "1",
"size": "2742",
"license": "apache-2.0",
"hash": -1502956988648188400,
"line_mean": 21.1129032258,
"line_max": 65,
"alpha_frac": 0.3099927061,
"autogenerated": false,
"ratio": 4.345483359746434,
"con... |
from django.test import TestCase
from wagtail.core.models import Collection
class TestCollectionTreeOperations(TestCase):
def setUp(self):
self.root_collection = Collection.get_first_root_node()
self.holiday_photos_collection = self.root_collection.add_child(
name="Holiday photos"
... | {
"repo_name": "kaedroho/wagtail",
"path": "wagtail/core/tests/test_collection_model.py",
"copies": "7",
"size": "4574",
"license": "bsd-3-clause",
"hash": -6796124059199817000,
"line_mean": 40.5818181818,
"line_max": 116,
"alpha_frac": 0.6154350678,
"autogenerated": false,
"ratio": 3.834031852472... |
from django.test import TestCase
from wagtailmenus.conf import constants
from wagtailmenus.models import MainMenu
from wagtailmenus.tests import base, utils
Page = utils.get_page_model()
class MainMenuTestCase(TestCase):
"""A base TestCase class for testing MainMenu model class methods"""
fixtures = ['test... | {
"repo_name": "rkhleics/wagtailmenus",
"path": "wagtailmenus/tests/test_mainmenu_class.py",
"copies": "2",
"size": "9474",
"license": "mit",
"hash": -7542180104501554000,
"line_mean": 37.2016129032,
"line_max": 104,
"alpha_frac": 0.5953134896,
"autogenerated": false,
"ratio": 3.94421315570358,
... |
from django.test import TestCase
from wagtail.wagtailsearch import index
from wagtail.tests.search import models
class TestContentTypeNames(TestCase):
def test_base_content_type_name(self):
name = models.SearchTestChild.indexed_get_toplevel_content_type()
self.assertEqual(name, 'searchtests_searc... | {
"repo_name": "jordij/wagtail",
"path": "wagtail/wagtailsearch/tests/test_indexed_class.py",
"copies": "31",
"size": "2750",
"license": "bsd-3-clause",
"hash": -6081080435715068000,
"line_mean": 39.4411764706,
"line_max": 92,
"alpha_frac": 0.6610909091,
"autogenerated": false,
"ratio": 3.98550724... |
from django.test import TestCase
from waldur_openstack.openstack_tenant.executors import InstanceFloatingIPsUpdateExecutor
from .. import factories
class InstanceFloatingIPsUpdateExecutorTest(TestCase):
def setUp(self):
self.executor = InstanceFloatingIPsUpdateExecutor()
self.instance = factori... | {
"repo_name": "opennode/nodeconductor-openstack",
"path": "src/waldur_openstack/openstack_tenant/tests/unittests/test_executors.py",
"copies": "1",
"size": "1026",
"license": "mit",
"hash": 4260713712497658000,
"line_mean": 37,
"line_max": 89,
"alpha_frac": 0.7183235867,
"autogenerated": false,
"... |
from django.test import TestCase
from waldur_openstack.openstack_tenant.executors import (
InstanceFloatingIPsUpdateExecutor,
)
from .. import factories
class InstanceFloatingIPsUpdateExecutorTest(TestCase):
def setUp(self):
self.executor = InstanceFloatingIPsUpdateExecutor()
self.instance =... | {
"repo_name": "opennode/waldur-mastermind",
"path": "src/waldur_openstack/openstack_tenant/tests/unittests/test_executors.py",
"copies": "2",
"size": "1034",
"license": "mit",
"hash": 807805268995123500,
"line_mean": 35.9285714286,
"line_max": 87,
"alpha_frac": 0.7127659574,
"autogenerated": false,... |
from django.test import TestCase
from web.models import Player, Game, Move
class PlayerGameMoveModelTest(TestCase):
def setUp(self):
# generate players
self.player1 = Player.objects.create(username='anonymous1', type='anonymous')
self.player2 = Player.objects.create(username='anonymous2... | {
"repo_name": "NejcZupec/tictactoe",
"path": "web/test/test_models.py",
"copies": "1",
"size": "2944",
"license": "apache-2.0",
"hash": 4572361921623629300,
"line_mean": 36.2658227848,
"line_max": 85,
"alpha_frac": 0.609375,
"autogenerated": false,
"ratio": 3.168998923573735,
"config_test": tru... |
from django.test import TestCase
from webrtc import MediaStream, SDPHelper, ICEAgent, STUNAgent, RTCPeerConnection
import pprint
class SDPHelperTest(TestCase):
def test_decodesdp(self):
with open("client/sdp_decodetest.txt", "r") as f:
data = SDPHelper().message_decode(f.read())
... | {
"repo_name": "ddalex/p9",
"path": "client/tests.py",
"copies": "1",
"size": "8341",
"license": "mit",
"hash": -2577929011713101000,
"line_mean": 43.3670212766,
"line_max": 177,
"alpha_frac": 0.6406905647,
"autogenerated": false,
"ratio": 3.598360655737705,
"config_test": true,
"has_no_keywor... |
from django.test import TestCase
from whats_fresh.whats_fresh_api.models import (ProductPreparation, Product,
Preparation)
from django.contrib.gis.db import models
class ProductPreparationTestCase(TestCase):
def setUp(self):
self.expected_fields = {
... | {
"repo_name": "iCHAIT/whats-fresh-api",
"path": "whats_fresh/whats_fresh_api/tests/models/test_product_preparation_model.py",
"copies": "2",
"size": "1456",
"license": "apache-2.0",
"hash": -7638855440434799000,
"line_mean": 36.3333333333,
"line_max": 77,
"alpha_frac": 0.5961538462,
"autogenerated"... |
from django.test import TestCase
from whats_fresh.whats_fresh_api.models import Video
from django.contrib.gis.db import models
class VideoTestCase(TestCase):
def setUp(self):
self.expected_fields = {
'video': models.URLField,
'caption': models.TextField,
'name': models... | {
"repo_name": "osu-cass/whats-fresh-api",
"path": "whats_fresh/whats_fresh_api/tests/models/test_video_model.py",
"copies": "2",
"size": "1383",
"license": "apache-2.0",
"hash": 6460074308380785000,
"line_mean": 33.575,
"line_max": 78,
"alpha_frac": 0.6160520607,
"autogenerated": false,
"ratio": ... |
from django.test import TestCase
from yacon.models.site import Site
from yacon.models.pages import Page, DoubleAliasException
from yacon.models.hierarchy import Node
from yacon.tests.utils import create_test_site
# ============================================================================
class PageTests(TestCase... | {
"repo_name": "cltrudeau/django-yacon",
"path": "yacon/tests/test_pages.py",
"copies": "1",
"size": "2821",
"license": "mit",
"hash": 1595511317226590500,
"line_mean": 36.1184210526,
"line_max": 78,
"alpha_frac": 0.6189294576,
"autogenerated": false,
"ratio": 3.9344490934449095,
"config_test": ... |
from django.test import TestCase
from yawf.messages.spec import MessageSpec
from yawf.messages.common import message_spec_fabric
__all__ = ('MessageSpecsTestCase',)
class MessageSpecsTestCase(TestCase):
def test_grouping(self):
class Spec1(MessageSpec):
id = 'edit'
self.assertFals... | {
"repo_name": "freevoid/yawf",
"path": "yawf/tests/message_specs.py",
"copies": "1",
"size": "1928",
"license": "mit",
"hash": -2966801063114737700,
"line_mean": 23.7179487179,
"line_max": 59,
"alpha_frac": 0.5726141079,
"autogenerated": false,
"ratio": 4.1373390557939915,
"config_test": true,
... |
from django.test import TestCase
from yawf.permissions import C, allow_to_all, restrict_to_all
__all__ = ('PermissionsTestCase',)
class PermissionsTestCase(TestCase):
@staticmethod
def call_count(func):
func.call_count = 0
def wrapper(*args):
func.call_count += 1
ret... | {
"repo_name": "freevoid/yawf",
"path": "yawf/tests/permissions.py",
"copies": "1",
"size": "4065",
"license": "mit",
"hash": 1385501932842088400,
"line_mean": 36.6388888889,
"line_max": 82,
"alpha_frac": 0.6302583026,
"autogenerated": false,
"ratio": 3.4217171717171717,
"config_test": true,
"... |
from django.test import TestCase
from zerver.lib.initial_password import initial_password
from zerver.lib.db import TimeTrackingCursor
from zerver.lib import cache
from zerver.lib import event_queue
from zerver.worker import queue_processors
from zerver.lib.actions import (
check_send_message, create_stream_if_ne... | {
"repo_name": "deer-hope/zulip",
"path": "zerver/lib/test_helpers.py",
"copies": "113",
"size": "12407",
"license": "apache-2.0",
"hash": -4854322430955164000,
"line_mean": 34.4485714286,
"line_max": 102,
"alpha_frac": 0.6341581365,
"autogenerated": false,
"ratio": 3.9250237266687757,
"config_t... |
from django.test import TestCase
import accounts.tests.factories
import accounts.models
class UserAccountModelTest(TestCase):
def setUp(self):
self.user = accounts.tests.factories.UserFactory(username='stuff')
self.user_2 = accounts.tests.factories.UserFactory(username='{{ project_name }}_2')
... | {
"repo_name": "tiagoarasilva/django-boilerplate",
"path": "project_name/accounts/tests/models_tests.py",
"copies": "1",
"size": "2070",
"license": "mit",
"hash": -7743439679210033000,
"line_mean": 30.3636363636,
"line_max": 96,
"alpha_frac": 0.6748792271,
"autogenerated": false,
"ratio": 3.883677... |
from django.test import TestCase
import adapter
from .models import AvailableProperty
class AdapterTest(TestCase):
available_property = {
u'geometry': {u'y': 39.9664, u'x': -75.2079},
u'attributes': {
u'ASSET_ID': 14208,
u'OBJECTID': 35851,
u'DESCR': None,
... | {
"repo_name": "ebrelsford/django-phillydata",
"path": "phillydata/availableproperties/tests.py",
"copies": "1",
"size": "1845",
"license": "bsd-3-clause",
"hash": -8499483639014819000,
"line_mean": 31.3684210526,
"line_max": 75,
"alpha_frac": 0.5718157182,
"autogenerated": false,
"ratio": 3.81198... |
from django.test import TestCase
import djlotrek.aes
class AESTestCase(TestCase):
def test_aes(self):
"""
aes.encode() module pass a raw string and return
AES encoded string and aes.decode() module pass
an encoded AES string and return decoded string
"""
enc = djl... | {
"repo_name": "lotrekagency/djlotrek",
"path": "tests/test_aes.py",
"copies": "1",
"size": "1198",
"license": "mit",
"hash": -6032762150393228000,
"line_mean": 32.2222222222,
"line_max": 59,
"alpha_frac": 0.631270903,
"autogenerated": false,
"ratio": 2.9530864197530864,
"config_test": false,
... |
from django.test import TestCase
import dominion.cards
from dominion.cards.apps import CardAppConfig, create_cards
from dominion.cards.models import Card, CardInstance, Treasure, Victory
from dominion.games.factories import GameFactory
class SmokeTestCase(TestCase):
def test_string_method(self):
for card... | {
"repo_name": "jlward/dominion",
"path": "dominion/cards/tests.py",
"copies": "1",
"size": "2565",
"license": "mit",
"hash": -5964490321762898000,
"line_mean": 34.1369863014,
"line_max": 71,
"alpha_frac": 0.6576998051,
"autogenerated": false,
"ratio": 3.3839050131926123,
"config_test": true,
... |
from django.test import TestCase
import floppyforms as forms
from floppyforms import widgets
from floppyforms.templatetags.floppyforms import ConfigFilter, FormConfig
class AgeField(forms.IntegerField):
pass
class RegistrationForm(forms.Form):
name = forms.CharField(label='First- and Lastname', max_length... | {
"repo_name": "agconti/njode",
"path": "env/lib/python2.7/site-packages/tests/rendering.py",
"copies": "1",
"size": "8583",
"license": "bsd-3-clause",
"hash": 5650755345608249000,
"line_mean": 36.8105726872,
"line_max": 89,
"alpha_frac": 0.6385879063,
"autogenerated": false,
"ratio": 4.2239173228... |
from django.test import TestCase
import floppyforms as forms
class IntegerFieldTests(TestCase):
def test_parse_int(self):
int_field = forms.IntegerField()
result = int_field.clean('15')
self.assertEqual(15, result)
self.assertIsInstance(result, int)
def test_pass_values(self)... | {
"repo_name": "agconti/njode",
"path": "env/lib/python2.7/site-packages/tests/fields.py",
"copies": "1",
"size": "1053",
"license": "bsd-3-clause",
"hash": 5292086321975855000,
"line_mean": 31.90625,
"line_max": 88,
"alpha_frac": 0.5631528965,
"autogenerated": false,
"ratio": 3.7607142857142857,
... |
from django.test import TestCase
import logging
log = logging.getLogger(__name__)
###############################################
## test blog model
###############################################
from blog.models import Blog, Tag, BlogTag
class TestBlog(TestCase):
fixtures = ['auth.json','blog.json',]
# ... | {
"repo_name": "vollov/django-blog",
"path": "blog/tests.py",
"copies": "1",
"size": "4457",
"license": "mit",
"hash": -194563648669426560,
"line_mean": 31.3043478261,
"line_max": 103,
"alpha_frac": 0.4832847207,
"autogenerated": false,
"ratio": 3.7707275803722506,
"config_test": true,
"has_no... |
from django.test import TestCase
import mock
from docutils import nodes, utils
from readthedocs_ext.comments import backend, hasher, translator
def _pass(*args, **kwargs):
pass
class TestBuildCommand(TestCase):
'''Test Sphinx Extension'''
def setUp(self):
self.nodes = {
u'nil-0-0... | {
"repo_name": "Carreau/readthedocs.org",
"path": "readthedocs/rtd_tests/tests/test_sphinx_extension.py",
"copies": "3",
"size": "6097",
"license": "mit",
"hash": -5027949967737673000,
"line_mean": 47.0157480315,
"line_max": 117,
"alpha_frac": 0.7032967033,
"autogenerated": false,
"ratio": 2.72187... |
from django.test import TestCase
import mock
from templatetags import active
from msgvis.apps.corpus import models as corpus_models
from django.utils import timezone as tz
from datetime import timedelta
class TemplateTagActiveTest(TestCase):
def test_matches_request_path(self):
request = mock.Mock()
... | {
"repo_name": "hds-lab/textvisdrg",
"path": "msgvis/apps/base/tests.py",
"copies": "1",
"size": "11734",
"license": "mit",
"hash": -8220663717997657000,
"line_mean": 35.7836990596,
"line_max": 109,
"alpha_frac": 0.5937446736,
"autogenerated": false,
"ratio": 4.623325453112687,
"config_test": tr... |
from django.test import TestCase
import mock
from credentials.models import SshKeyPair
class SshKeyPairTest(TestCase):
public_key = """ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTx+Q1k+3Rej6giYUQtZ9rgqqz0/crkyVaKOUL1h/lr6ORmjAABy6iCVDY1jvIBHv2//a7eOW/Na86p6UtYO+vHF5S0EC+Fl6pQoXmAiPVp6MqyA8psj2b6YaNW9CKmp2OtzFvpmnz... | {
"repo_name": "caio1982/capomastro",
"path": "credentials/tests/test_keys.py",
"copies": "1",
"size": "2811",
"license": "mit",
"hash": -6747427232088609000,
"line_mean": 52.0377358491,
"line_max": 413,
"alpha_frac": 0.8477410174,
"autogenerated": false,
"ratio": 1.6623299822590183,
"config_tes... |
from django.test import TestCase
import os
import mock
from appengine_toolkit import on_appengine, config, parse
class TestToolkit(TestCase):
def test_on_appengine(self):
self.assertFalse(on_appengine())
os.environ['SERVER_SOFTWARE'] = 'Google App Engine Fake'
self.assertTrue(on_appengin... | {
"repo_name": "masci/django-appengine-toolkit",
"path": "tests/test_toolkit.py",
"copies": "1",
"size": "2023",
"license": "bsd-3-clause",
"hash": 2458066732585415700,
"line_mean": 31.1111111111,
"line_max": 67,
"alpha_frac": 0.553633218,
"autogenerated": false,
"ratio": 3.8680688336520075,
"co... |
from django.test import TestCase
import os
import uuid
from bs4 import BeautifulSoup as Soup
from paloma.models import (
Template,
Message,
)
class TemplateTest(TestCase):
fixtrues = ['auth.json', ]
def test_get_template(self):
"""
python manage.py test shops.TemplateTest.test_get_t... | {
"repo_name": "hdknr/paloma",
"path": "example/shops/tests.py",
"copies": "1",
"size": "2966",
"license": "bsd-2-clause",
"hash": -1056729207325606100,
"line_mean": 29.5773195876,
"line_max": 71,
"alpha_frac": 0.5718138908,
"autogenerated": false,
"ratio": 3.9129287598944593,
"config_test": tru... |
from django.test import TestCase
import pytest
from . import amazon
# Create your tests here.
def test_file_credentials():
creds = amazon.file_credentials()
assert len(creds) == 3
def test_connection():
assert amazon.search_books(Keywords='Python')
@pytest.mark.django_db
def test_amazon_adapter():
... | {
"repo_name": "hacktm15/caudexer",
"path": "dexer/caudexer/tests.py",
"copies": "2",
"size": "1046",
"license": "mit",
"hash": 3055887697607858700,
"line_mean": 25.8205128205,
"line_max": 77,
"alpha_frac": 0.6998087954,
"autogenerated": false,
"ratio": 3.238390092879257,
"config_test": true,
... |
from django.test import TestCase
# local test models
from models import Holder, Inner, InnerInline
from models import Holder2, Inner2, Holder3, Inner3
from models import Person, OutfitItem, Fashionista
class TestInline(TestCase):
fixtures = ['admin-views-users.xml']
def setUp(self):
holder = Holder(d... | {
"repo_name": "Smarsh/django",
"path": "tests/regressiontests/admin_inlines/tests.py",
"copies": "10",
"size": "4217",
"license": "bsd-3-clause",
"hash": -5868546109345157000,
"line_mean": 40.3431372549,
"line_max": 93,
"alpha_frac": 0.6435854873,
"autogenerated": false,
"ratio": 3.75846702317290... |
from django.test import TestCase
{{ model_import }}
class {{ model_name }}Tests(TestCase):
def test_create_get(self):
url = reverse('{{ create_url }}')
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
def test_create_post_creates_{{ model_name|lower }}(s... | {
"repo_name": "grantmcconnaughey/django-app-gen",
"path": "appgen/templates/appgen/python/tests.py",
"copies": "1",
"size": "2667",
"license": "bsd-3-clause",
"hash": 8868416372695207000,
"line_mean": 33.6363636364,
"line_max": 91,
"alpha_frac": 0.6119235096,
"autogenerated": false,
"ratio": 3.88... |
from django.test import TestCase
class CalendarTestCase(TestCase):
def setUp(self):
pass
def test_empty_day(self):
response = self.client.get('/calendar/events/2014/2/1/')
self.assertTrue(response.status_code, 200)
self.assertJSONEqual(response.content, "[]")
def test_emp... | {
"repo_name": "RockingRolli/django-event-calendar",
"path": "event_calendar/tests.py",
"copies": "1",
"size": "1411",
"license": "mit",
"hash": -2613878578304347600,
"line_mean": 34.3,
"line_max": 93,
"alpha_frac": 0.6009922041,
"autogenerated": false,
"ratio": 4.125730994152047,
"config_test":... |
from django.test import TestCase
class DjangoMarkdownTestCase(TestCase):
def test_base(self):
from django_markdown.utils import markdown
self.assertEqual(markdown('**test**'), '<p><strong>test</strong></p>')
def test_filters(self):
from django_markdown.templatetags.django_markdown im... | {
"repo_name": "ojengwa/talk",
"path": "venv/lib/python2.7/site-packages/django_markdown/tests.py",
"copies": "3",
"size": "1710",
"license": "mit",
"hash": -6889093030340047000,
"line_mean": 40.7073170732,
"line_max": 128,
"alpha_frac": 0.6204678363,
"autogenerated": false,
"ratio": 3.84269662921... |
from django.test import TestCase
class FormsTest(TestCase):
def test_upload_form(self):
import os
from feedshare.feedlists.forms import FeedListUploadForm
from feedshare.feedlists.models import FeedList
from django.core.files.uploadedfile import SimpleUploadedFile
# empty... | {
"repo_name": "holzenburg/feedshare",
"path": "feedshare/feedlists/tests.py",
"copies": "1",
"size": "3561",
"license": "mit",
"hash": 1465243783184217600,
"line_mean": 27.7177419355,
"line_max": 74,
"alpha_frac": 0.5717495086,
"autogenerated": false,
"ratio": 3.8918032786885246,
"config_test":... |
from django.test import TestCase
class ProjectsHomeTemplateContextTestCase(TestCase):
"""
Test methods for projects_home page.
"""
fixtures = ["tester2.json"]
def setUp(self):
"""
Get projects_home page.
"""
self.response = self.client.get('/projects/')
def te... | {
"repo_name": "zachsnyder1/zachsite",
"path": "projects/tests.py",
"copies": "1",
"size": "3454",
"license": "mit",
"hash": 3768445005048169000,
"line_mean": 31.8952380952,
"line_max": 119,
"alpha_frac": 0.6328894036,
"autogenerated": false,
"ratio": 4.3776932826362485,
"config_test": true,
"... |
from django.test import TestCase
class TestCyclicQueries(TestCase):
def test_projects(self):
body = {
'query': '''{
projects {
name
}
}'''
}
response = self.client.get('/graphql', body, HTTP_ACCEPT="application/j... | {
"repo_name": "mastizada/pontoon",
"path": "pontoon/api/tests/test_schema.py",
"copies": "1",
"size": "4144",
"license": "bsd-3-clause",
"hash": -5521369285764875000,
"line_mean": 27.7777777778,
"line_max": 84,
"alpha_frac": 0.3581081081,
"autogenerated": false,
"ratio": 5.954022988505747,
"con... |
from django.test import TestCase
class Tester(TestCase):
# /app/page.function/urlparams
def test_app_page_function(self):
resp = self.client.get('/homepage/index.basic/1/2/3/')
self.assertEqual(resp.status_code, 200)
req = resp.wsgi_request
self.assertEqual(req.dmp.app, 'homep... | {
"repo_name": "doconix/django-mako-plus",
"path": "tests_project/homepage/tests/test_middleware.py",
"copies": "1",
"size": "3815",
"license": "apache-2.0",
"hash": 391698327991482400,
"line_mean": 42.3522727273,
"line_max": 65,
"alpha_frac": 0.643774574,
"autogenerated": false,
"ratio": 3.588899... |
from django.test import TestCase
class TestExtractBasicauth(TestCase):
def _callFUT(self, *args, **kwargs):
from basicauth.basicauthutils import extract_basicauth
return extract_basicauth(*args, **kwargs)
def test__it(self):
actual = self._callFUT("Basic dXNlcm5hbWU6cGFzc3dvcmQ=")
... | {
"repo_name": "hirokiky/django-basicauth",
"path": "tests/test_basicauthutils.py",
"copies": "1",
"size": "1309",
"license": "mit",
"hash": 3285559152014755300,
"line_mean": 34.3783783784,
"line_max": 72,
"alpha_frac": 0.666157372,
"autogenerated": false,
"ratio": 3.347826086956522,
"config_tes... |
from django.test import TestCase
class TestPages(TestCase):
fixtures = ['auth', 'audiologists', 'clients', 'providers', 'grantors', 'settings']
def setUp(self):
assert self.client.login(username='admin', password='admin')
def test_admin_root(self):
resp = self.client.get('/admin/', secu... | {
"repo_name": "deafhhs/adapt",
"path": "clients/tests.py",
"copies": "1",
"size": "3049",
"license": "mit",
"hash": 8005566596626895000,
"line_mean": 33.6477272727,
"line_max": 87,
"alpha_frac": 0.6480813381,
"autogenerated": false,
"ratio": 3.616844602609727,
"config_test": true,
"has_no_key... |
from django.test import TestCase
def _get_cache(backend):
try:
# 1.9+
from django.core.cache import caches
except ImportError:
# <1.9
from django.core.cache import get_cache
return get_cache(backend)
return caches[backend]
class BaseCacheTestCase(TestCase):
d... | {
"repo_name": "lincolnloop/django-ft-cache",
"path": "tests.py",
"copies": "1",
"size": "1452",
"license": "bsd-3-clause",
"hash": -8987777463190839000,
"line_mean": 26.9230769231,
"line_max": 75,
"alpha_frac": 0.5929752066,
"autogenerated": false,
"ratio": 3.7326478149100257,
"config_test": tr... |
from django.test import TestCase
from .helpers.factories import EventFactory
from ..models import Event
from users.tests.helpers import UserFactory
class EventsManagerTestCase(TestCase):
def test_get_current_of(self):
user_with_active_event = UserFactory()
user_with_passive_event = UserFactory(... | {
"repo_name": "42cc/p2psafety",
"path": "p2psafety_django/events/tests/test_managers.py",
"copies": "1",
"size": "1080",
"license": "apache-2.0",
"hash": -6952463611243465000,
"line_mean": 42.2,
"line_max": 95,
"alpha_frac": 0.662037037,
"autogenerated": false,
"ratio": 4.302788844621514,
"conf... |
from django.test import TestCase
# Test models
from .models import Product, Order
from django.contrib.auth.models import User
class ProductTestCase(TestCase):
fixtures = ['user.json', 'store.json']
def test_create_store(self):
"""user anna can create store"""
class OrderTestCase(TestC... | {
"repo_name": "vollov/sm",
"path": "django/sales/tests.py",
"copies": "1",
"size": "1156",
"license": "mit",
"hash": -8478396034035514000,
"line_mean": 27.2195121951,
"line_max": 61,
"alpha_frac": 0.5813148789,
"autogenerated": false,
"ratio": 3.958904109589041,
"config_test": true,
"has_no_k... |
from django.test import TestCase
try:
from django.contrib.staticfiles.templatetags.staticfiles import static
except ImportError:
from django.templatetags.static import static
try:
from django.core.urlresolvers import reverse
except ImportError:
from django.urls import reverse
from ..templatetags.adja... | {
"repo_name": "snogaraleal/adjax",
"path": "adjax/tests/test_templatetags.py",
"copies": "1",
"size": "1451",
"license": "mit",
"hash": -4097807521762238000,
"line_mean": 29.8723404255,
"line_max": 74,
"alpha_frac": 0.6064782908,
"autogenerated": false,
"ratio": 3.7590673575129534,
"config_test... |
from django.test import TestCase
# Uncomment when models ready to test.
# from .models import Artist, Album, Track, Genre
"""
class TestModels(TestCase):
@classmethod
def setUpTestData(cls):
cls.artists = {
"beatles": Artist.objects.create(name="Beatles"),
}
cls.albums = ... | {
"repo_name": "Clever-Hacksaw/musiclibrary",
"path": "music/test_views.py",
"copies": "1",
"size": "2001",
"license": "mit",
"hash": -382645297868654000,
"line_mean": 30.7777777778,
"line_max": 96,
"alpha_frac": 0.6146926537,
"autogenerated": false,
"ratio": 3.5668449197860963,
"config_test": t... |
from django.test import TestCase
print ('test_models running')
# Create your tests here.
from catalog.models import Author
class AuthorModelTest(TestCase):
@classmethod
def setUpTestData(cls):
#Set up non-modified objects used by all test methods
Author.objects.create(first_name='Big', last_n... | {
"repo_name": "mrmarkhurlburt/django_media_library",
"path": "catalog/tests/test_models.py",
"copies": "1",
"size": "1802",
"license": "cc0-1.0",
"hash": 3140911555912927000,
"line_mean": 39.0666666667,
"line_max": 79,
"alpha_frac": 0.6764705882,
"autogenerated": false,
"ratio": 3.505836575875486... |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.gis.geos import *
from django.contrib.auth.models import User, AnonymousUser
from django import template
import time
#from knesset.mks.server_urls import mock_pingback_se... | {
"repo_name": "haithamk/oMap",
"path": "src/map/map_info/tests.py",
"copies": "1",
"size": "2680",
"license": "bsd-3-clause",
"hash": -8165368129502391000,
"line_mean": 25.0194174757,
"line_max": 108,
"alpha_frac": 0.652238806,
"autogenerated": false,
"ratio": 3.0698739977090495,
"config_test":... |
from django.test import TestCase, override_settings
from django.contrib.auth import get_user_model
from django.core import mail
from django.conf import settings
from django.utils.encoding import force_text
from allauth.account import app_settings as account_app_settings
from rest_framework import status
from rest_fram... | {
"repo_name": "Tivix/django-rest-auth",
"path": "rest_auth/tests/test_api.py",
"copies": "2",
"size": "18192",
"license": "mit",
"hash": 2553893349137475000,
"line_mean": 34.1196911197,
"line_max": 120,
"alpha_frac": 0.6097735268,
"autogenerated": false,
"ratio": 3.7664596273291924,
"config_tes... |
from django.test import TestCase, override_settings
from django.core.exceptions import FieldDoesNotExist
from django.contrib.gis.geos import Point
from uk_geo_utils.geocoders import (
AddressBaseGeocoder,
get_address_model,
get_onsud_model,
AddressBaseNotImportedException,
CodesNotFoundException,
... | {
"repo_name": "chris48s/UK-Polling-Stations",
"path": "polling_stations/apps/uk_geo_utils/tests/test_addressbase_geocoder.py",
"copies": "1",
"size": "6608",
"license": "bsd-3-clause",
"hash": 541191176904597440,
"line_mean": 39.0484848485,
"line_max": 106,
"alpha_frac": 0.6417978208,
"autogenerate... |
from django.test import TestCase, override_settings
from django.core.urlresolvers import reverse
from django.core import mail
from wagtail.tests.utils import WagtailTestUtils
from wagtail.wagtailcore.models import Page
from wagtail.wagtailadmin.utils import send_mail
class TestHome(TestCase, WagtailTestUtils):
d... | {
"repo_name": "janusnic/wagtail",
"path": "wagtail/wagtailadmin/tests/tests.py",
"copies": "6",
"size": "5408",
"license": "bsd-3-clause",
"hash": -6340835953615194000,
"line_mean": 46.4385964912,
"line_max": 148,
"alpha_frac": 0.6839866864,
"autogenerated": false,
"ratio": 3.734806629834254,
"... |
from django.test import TestCase, override_settings
from django.template import Context, Template
from django.test.client import RequestFactory
class TestActiveLink(TestCase):
def setUp(self):
self.client = RequestFactory()
def test_no_request(self):
template = Template("""
{% lo... | {
"repo_name": "valerymelou/django-active-link",
"path": "tests/test_tags.py",
"copies": "1",
"size": "4700",
"license": "bsd-3-clause",
"hash": -3806119415206066000,
"line_mean": 34.8778625954,
"line_max": 79,
"alpha_frac": 0.5614893617,
"autogenerated": false,
"ratio": 4.26497277676951,
"confi... |
from django.test import TestCase, override_settings
from django.test import Client
from django.core import mail
from django.contrib.auth.models import User
from django.utils import timezone
from django.utils.translation import get_language
from django.conf import settings
from django.urls import reverse
from unittest.... | {
"repo_name": "p2pu/learning-circles",
"path": "studygroups/tests/test_tasks.py",
"copies": "1",
"size": "22015",
"license": "mit",
"hash": -3474700003031763000,
"line_mean": 41.582205029,
"line_max": 265,
"alpha_frac": 0.6387008858,
"autogenerated": false,
"ratio": 3.511164274322169,
"config_t... |
from django.test import TestCase, override_settings
from django.test import TestCase, modify_settings, override_settings
from wagtailsystemtext import app_settings
from wagtailsystemtext.utils import (
systemtext, set_site, fill_cache, preload, _cleanup,
)
from tests.factories import SiteFactory, PageFactory, Syst... | {
"repo_name": "Frojd/wagtail-systemtext",
"path": "tests/test_replace.py",
"copies": "1",
"size": "3839",
"license": "mit",
"hash": -5804183606892627000,
"line_mean": 25.6597222222,
"line_max": 88,
"alpha_frac": 0.5756707476,
"autogenerated": false,
"ratio": 4.323198198198198,
"config_test": tr... |
from django.test import TestCase, override_settings
from django.urls import reverse
from wagtail.core.models import Page
from wagtail.tests.utils import WagtailTestUtils
class TestLoginView(TestCase, WagtailTestUtils):
fixtures = ['test.json']
def setUp(self):
self.user = self.create_test_user()
... | {
"repo_name": "wagtail/wagtail",
"path": "wagtail/admin/tests/test_views.py",
"copies": "8",
"size": "2664",
"license": "bsd-3-clause",
"hash": -6506914822119074000,
"line_mean": 41.9677419355,
"line_max": 89,
"alpha_frac": 0.6662912913,
"autogenerated": false,
"ratio": 3.9820627802690582,
"con... |
from django.test import TestCase, override_settings
from elasticsearch.exceptions import ConnectionError
from corehq.apps.es import FormES
from corehq.elastic import get_es_new
from corehq.form_processor.interfaces.processor import FormProcessorInterface
from corehq.form_processor.tests.utils import FormProcessorTestU... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "testapps/test_pillowtop/tests/test_report_xform_pillow.py",
"copies": "1",
"size": "4342",
"license": "bsd-3-clause",
"hash": 5865150309512210000,
"line_mean": 40.3523809524,
"line_max": 91,
"alpha_frac": 0.7029018885,
"autogenerated": false,
"rat... |
from django.test import TestCase, override_settings
from .factories import PhotoFactory
from ..models import Photo
@override_settings(ROOT_URLCONF='photologue.tests.test_urls')
class RequestPhotoTest(TestCase):
def setUp(self):
super(RequestPhotoTest, self).setUp()
self.photo = PhotoFactory(slug=... | {
"repo_name": "JoannaKielas/wedding-gallery",
"path": "photologue/tests/test_views_photo.py",
"copies": "3",
"size": "1915",
"license": "bsd-3-clause",
"hash": 3930899953047407000,
"line_mean": 33.8181818182,
"line_max": 74,
"alpha_frac": 0.661618799,
"autogenerated": false,
"ratio": 3.7771203155... |
from django.test import TestCase, override_settings
from .factories import RoleFactory
from mellow.roles import Role
from mellow.settings import DEFAULT_MELLOW_ROLES
class RoleTestCase(TestCase):
def setUp(self):
Role.clear_roles()
self.role_1 = RoleFactory.create()
self.role_2 = RoleFacto... | {
"repo_name": "flagshipenterprise/django-mellow-auth",
"path": "mellow/tests/test_roles.py",
"copies": "1",
"size": "3485",
"license": "mit",
"hash": -7499416852083756000,
"line_mean": 42.024691358,
"line_max": 80,
"alpha_frac": 0.6608321377,
"autogenerated": false,
"ratio": 3.347742555235351,
... |
from django.test import TestCase, override_settings
import urlparse
from .factories import UserFactory, VoterFactory, SubmissionFactory
@override_settings(SITE_DOMAIN_WITH_PROTOCOL="https://example.net")
class SubmissionReallyAbsoluteUrlTest(TestCase):
def setUp(self):
self.submission = SubmissionFactor... | {
"repo_name": "ejucovy/django-opendebates",
"path": "opendebates/tests/test_models.py",
"copies": "1",
"size": "2811",
"license": "apache-2.0",
"hash": 6485343027400706000,
"line_mean": 40.3382352941,
"line_max": 80,
"alpha_frac": 0.6663109214,
"autogenerated": false,
"ratio": 3.7035573122529644,... |
from django.test import TestCase, override_settings
from mainapp.models import Paper, File
@override_settings(
ELASTICSEARCH_DSL_AUTOSYNC=False, ELASTICSEARCH_DSL_AUTO_REFRESH=False
)
class TestDocumentAccess(TestCase):
fixtures = ["initdata"]
base_paper_len = 2
def test_delete_document(self):
... | {
"repo_name": "meine-stadt-transparent/meine-stadt-transparent",
"path": "mainapp/tests/main/test_document_access.py",
"copies": "1",
"size": "1130",
"license": "mit",
"hash": -7069085426548783000,
"line_mean": 28.7368421053,
"line_max": 74,
"alpha_frac": 0.6460176991,
"autogenerated": false,
"ra... |
from django.test import TestCase, override_settings
from wagtailmenus.tests import utils
class GetSubMenuTemplateNamesMethodTestCase(TestCase):
"""
A 'base' test case for a testing a menu class's
get_sub_menu_template_names() method.
"""
expected_default_result_length = None
def get_test_me... | {
"repo_name": "rkhleics/wagtailmenus",
"path": "wagtailmenus/tests/base.py",
"copies": "2",
"size": "4539",
"license": "mit",
"hash": -7819032628888669000,
"line_mean": 37.1428571429,
"line_max": 110,
"alpha_frac": 0.6538885217,
"autogenerated": false,
"ratio": 3.8046940486169323,
"config_test"... |
from django.test import TestCase, override_settings
@override_settings(
TEMPLATE_CONTEXT_PROCESSORS=('django.core.context_processors.static',),
STATIC_URL='/path/to/static/media/',
)
class ShortcutTests(TestCase):
urls = 'view_tests.generic_urls'
def test_render_to_response(self):
response = ... | {
"repo_name": "wfxiang08/django178",
"path": "tests/view_tests/tests/test_shortcuts.py",
"copies": "15",
"size": "3416",
"license": "bsd-3-clause",
"hash": -9005720060818444000,
"line_mean": 47.8,
"line_max": 97,
"alpha_frac": 0.6879391101,
"autogenerated": false,
"ratio": 3.685005393743258,
"c... |
from django.test import TestCase, override_settings, SimpleTestCase
from mock import patch
from corehq.util.test_utils import generate_cases
from ..models import PillowCheckpointSeqStore
from ..utils import pillow_seq_store, EPSILON, parse_celery_workers, parse_celery_pings
def _get_dummy_pillow():
from pillowto... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "corehq/apps/hqadmin/tests/test_utils.py",
"copies": "1",
"size": "5133",
"license": "bsd-3-clause",
"hash": -337736548824224600,
"line_mean": 34.4,
"line_max": 119,
"alpha_frac": 0.6460159751,
"autogenerated": false,
"ratio": 3.632696390658174,
... |
from django.test import TestCase, RequestFactory, Client
from chat.views import ArchiveMessageOutboxView
from chat.models import Message
from user.models import HealthProfessional
class TestArchiveMessageOutboxView(TestCase):
def setUp(self):
self.user = HealthProfessional.objects.create(name='User Test... | {
"repo_name": "fga-gpp-mds/2017.2-Receituario-Medico",
"path": "medical_prescription/chat/test/test_view_archive_message_outbox.py",
"copies": "1",
"size": "1348",
"license": "mit",
"hash": -1453114306553755000,
"line_mean": 34.4736842105,
"line_max": 77,
"alpha_frac": 0.559347181,
"autogenerated":... |
from django.test import TestCase, RequestFactory, Client
from chat.views import UnarchiveMessageHealthProfessionalView
from chat.models import Message
from user.models import HealthProfessional, Patient
class TestUnarchiveMessageHealthProfessionalView(TestCase):
def setUp(self):
self.health_professional... | {
"repo_name": "fga-gpp-mds/2017.2-Receituario-Medico",
"path": "medical_prescription/chat/test/test_view_unarchive_message_health_professinal.py",
"copies": "1",
"size": "1914",
"license": "mit",
"hash": -8879033146828191000,
"line_mean": 41.5333333333,
"line_max": 92,
"alpha_frac": 0.5271682341,
"... |
from django.test import TestCase, RequestFactory, Client
from django.contrib.auth import SESSION_KEY
from django.urls import reverse
from django.core import mail
from accounts.views import signup
from accounts.models import CustomUser
class SignupTestCase(TestCase):
def setUp(self):
self.factory = Request... | {
"repo_name": "eSmelser/SnookR",
"path": "SnookR/accounts/tests.py",
"copies": "1",
"size": "1330",
"license": "mit",
"hash": -3605594687872716000,
"line_mean": 34.9459459459,
"line_max": 69,
"alpha_frac": 0.6421052632,
"autogenerated": false,
"ratio": 3.911764705882353,
"config_test": true,
... |
from django.test import TestCase, RequestFactory, Client
from django_todolist.todo.models import Todo
import json
class ApiTestCase(TestCase):
def setUp(self):
self.factory = RequestFactory()
self.client = Client()
def test_api_url(self):
response = self.client.get('/')
self.a... | {
"repo_name": "andresgz/django_todolist",
"path": "django_todolist/api/tests.py",
"copies": "1",
"size": "3262",
"license": "bsd-3-clause",
"hash": 4213445904707838000,
"line_mean": 39.2716049383,
"line_max": 78,
"alpha_frac": 0.5781729001,
"autogenerated": false,
"ratio": 4.160714285714286,
"c... |
from django.test import TestCase, RequestFactory, Client
from django.utils import timezone
from django.core.urlresolvers import reverse
from django.utils.translation import activate
from ekratia.users.models import User
from ekratia.referendums.models import Referendum
import logging
logger = logging.getLogger('ekrat... | {
"repo_name": "andresgz/ekratia",
"path": "ekratia/referendums/tests.py",
"copies": "1",
"size": "6626",
"license": "bsd-3-clause",
"hash": -1632039564717196000,
"line_mean": 36.8628571429,
"line_max": 73,
"alpha_frac": 0.6346211893,
"autogenerated": false,
"ratio": 3.4014373716632442,
"config_... |
from django.test import TestCase, RequestFactory
from bambu_analytics import track_event, events
class AnalyticsTrackingTestCase(TestCase):
def setUp(self):
self.factory = RequestFactory()
def test_track_page(self):
request = self.factory.get('/')
track_event(request, events.PAGE)
... | {
"repo_name": "iamsteadman/bambu-analytics",
"path": "bambu_analytics/test_tracking.py",
"copies": "1",
"size": "1220",
"license": "apache-2.0",
"hash": -8727588578155494000,
"line_mean": 28.7804878049,
"line_max": 53,
"alpha_frac": 0.5360655738,
"autogenerated": false,
"ratio": 4.250871080139372... |
from django.test import TestCase, RequestFactory
from chat.models import Message
from user.models import Patient, HealthProfessional
from chat.views import ArchiveBoxPatientView
class TestBoxPatient(TestCase):
def setUp(self):
# Create Patient.
self.patient = Patient.objects.create(name='Pacient... | {
"repo_name": "fga-gpp-mds/2017.2-Receituario-Medico",
"path": "medical_prescription/chat/test/test_view_archive_box_patient.py",
"copies": "1",
"size": "1845",
"license": "mit",
"hash": 2221526767868296000,
"line_mean": 32.5454545455,
"line_max": 86,
"alpha_frac": 0.5360433604,
"autogenerated": fa... |
from django.test import TestCase, RequestFactory
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
import logging
from .test_utility import test_util
import requests
from .views import get_closest_market
import json
from .models import Market
logger = logging.getLogger(__name__)
... | {
"repo_name": "sachinkumar123/approprate",
"path": "cloudApp/interface/tests.py",
"copies": "1",
"size": "4499",
"license": "mit",
"hash": 4728854277411339000,
"line_mean": 33.0909090909,
"line_max": 153,
"alpha_frac": 0.71527006,
"autogenerated": false,
"ratio": 3.642914979757085,
"config_test... |
from django.test import TestCase, RequestFactory
from django.contrib.auth import get_user_model
from blogs.models import Post, Edition
from blogs.forms import PostModelForm, PostCreationForm, PostUpdateForm
User = get_user_model()
class PostModelFormTest(TestCase):
def test_save(self):
self.assertEqua... | {
"repo_name": "ericmok/djangosimpleblog",
"path": "blogs/test_forms.py",
"copies": "1",
"size": "2333",
"license": "mit",
"hash": 1147086413908532400,
"line_mean": 33.8358208955,
"line_max": 121,
"alpha_frac": 0.6588084012,
"autogenerated": false,
"ratio": 3.824590163934426,
"config_test": true... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.