text stringlengths 0 1.05M | meta dict |
|---|---|
from django.test import TestCase
from datetime import datetime, timedelta
import random
import json
import zmq
from django.utils.timezone import make_aware, utc, now
from pytz import AmbiguousTimeError
import re
import time
fake_zmq_socket = None
class FakeZMQContext(object):
def socket(self, socket_type):
... | {
"repo_name": "ResEnv/chain-api",
"path": "chain/core/test_core.py",
"copies": "1",
"size": "51459",
"license": "mit",
"hash": -5259833457556427000,
"line_mean": 41.6691542289,
"line_max": 118,
"alpha_frac": 0.5829883985,
"autogenerated": false,
"ratio": 3.784028237370395,
"config_test": true,
... |
from django.test import TestCase
from datetime import timedelta, date
from dateutil.relativedelta import relativedelta
from django.contrib.auth import get_user_model
from runs.models import Run
from .models import Sponsorship
class SponsorshipTest(TestCase):
def setUp(self):
self.test_runner = get_user... | {
"repo_name": "Socialsquare/RunningCause",
"path": "sponsorship/tests.py",
"copies": "1",
"size": "3333",
"license": "mit",
"hash": 1652669760798803200,
"line_mean": 45.9436619718,
"line_max": 79,
"alpha_frac": 0.4752475248,
"autogenerated": false,
"ratio": 4.9231905465288035,
"config_test": tr... |
from django.test import TestCase
from decimal import Decimal as D
from oscar.apps.partner import strategy
from oscar.apps.catalogue import models
from oscar.test import factories
from oscar.apps.basket.models import Line
class ProductWithEmptyPriceTestMixin(object):
def test_product_with_empty_price(self):
... | {
"repo_name": "anandsimmy/ecommerce",
"path": "tests/integration/partner/test_strategy.py",
"copies": "2",
"size": "5386",
"license": "bsd-3-clause",
"hash": 937487094985341600,
"line_mean": 38.0289855072,
"line_max": 88,
"alpha_frac": 0.7016338656,
"autogenerated": false,
"ratio": 3.825284090909... |
from django.test import TestCase
from decimal import Decimal as D
from oscar.apps.partner import strategy
from oscar.apps.catalogue import models
from oscar.test import factories
class TestDefaultStrategy(TestCase):
def setUp(self):
self.strategy = strategy.Default()
def test_no_stockrecords(self):... | {
"repo_name": "ruddra/django-oscar",
"path": "tests/integration/partner/strategy_tests.py",
"copies": "5",
"size": "1258",
"license": "bsd-3-clause",
"hash": -7304250476416750000,
"line_mean": 36,
"line_max": 75,
"alpha_frac": 0.6844197138,
"autogenerated": false,
"ratio": 3.755223880597015,
"c... |
from django.test import TestCase
from decimal import Decimal as D
from oscar.core.prices import TaxNotKnown
from oscar.apps.partner import prices, models
class TestUnavailable(TestCase):
def setUp(self):
self.price = prices.Unavailable()
def test_means_unknown_tax(self):
self.assertFalse(se... | {
"repo_name": "abhidrona/gn-osc-custom",
"path": "tests/unit/partner/price_tests.py",
"copies": "6",
"size": "1518",
"license": "bsd-3-clause",
"hash": -1762872955464568800,
"line_mean": 27.641509434,
"line_max": 67,
"alpha_frac": 0.6772068511,
"autogenerated": false,
"ratio": 3.5057736720554273,... |
from django.test import TestCase
from decimal import Decimal
from jimi.price import fields
# All this is needed for temporary testing models
from django.conf import settings
from django.core.management import call_command
from django.db.models import loading
from models import TestModel
class CurrencyTest(TestCase)... | {
"repo_name": "bhell/jimi",
"path": "jimi/jimi/price/tests/tests.py",
"copies": "1",
"size": "8519",
"license": "bsd-3-clause",
"hash": -3946892950858297000,
"line_mean": 38.0779816514,
"line_max": 88,
"alpha_frac": 0.607817819,
"autogenerated": false,
"ratio": 3.886405109489051,
"config_test":... |
from django.test import TestCase
from directory.templatetags.directory_utils import get_selectable_pages
class FakePage(object):
class FakePaginator(object):
def __init__(self, total_num_pages):
self.num_pages = total_num_pages
self.page_range = [i for i in range(1, total_num_pages... | {
"repo_name": "wildfish/django-directory",
"path": "tests/test_template_tags_get_selectable_pages.py",
"copies": "1",
"size": "1854",
"license": "mit",
"hash": 1485545261386086100,
"line_mean": 42.1162790698,
"line_max": 210,
"alpha_frac": 0.6790722762,
"autogenerated": false,
"ratio": 3.09,
"c... |
from django.test import TestCase
from django.apps import apps
from django.urls import reverse
from wagtail.core.rich_text import RichText
from wagtail.core.models import Collection, Page
from wagtail.images.tests.utils import Image, get_test_image_file
from wagtail_feeds.models import RSSFeedsSettings
from wagtail_fe... | {
"repo_name": "chrisdev/django-wagtail-feeds",
"path": "tests/test_wagtail_feeds.py",
"copies": "1",
"size": "7622",
"license": "mit",
"hash": 240921790842001820,
"line_mean": 33.6454545455,
"line_max": 83,
"alpha_frac": 0.5814746786,
"autogenerated": false,
"ratio": 3.9968536969061352,
"config... |
from django.test import TestCase
from django_autolinks.utils import *
from django_autolinks.models import Link
class Autolinks(TestCase):
def setUp(self):
self.first_text = '''
[Minor example][minor] of autolinks.
This is a [my second post][second post].
[minor... | {
"repo_name": "svetlyak40wt/django-autolinks",
"path": "django_autolinks/tests.py",
"copies": "1",
"size": "2827",
"license": "bsd-3-clause",
"hash": -6332975635890528000,
"line_mean": 33.4756097561,
"line_max": 82,
"alpha_frac": 0.5366112487,
"autogenerated": false,
"ratio": 3.7394179894179893,
... |
from django.test import TestCase
from django.conf import settings
from authz_group import Group
ALL_OK_BACKEND = 'authz_group.authz_implementation.all_ok.AllOK'
ALL_FAIL_BACKEND = 'authz_group.authz_implementation.all_fail.AllFail'
SETTINGS_GROUP_BACKEND = 'authz_group.authz_implementation.settings.Settings'
class T... | {
"repo_name": "uw-it-aca/authz_group",
"path": "authz_group/tests.py",
"copies": "1",
"size": "1367",
"license": "apache-2.0",
"hash": 4563233416919380500,
"line_mean": 38.0571428571,
"line_max": 78,
"alpha_frac": 0.636430139,
"autogenerated": false,
"ratio": 3.550649350649351,
"config_test": t... |
from django.test import TestCase
from django.conf import settings
from ballot_box.models import *
from election_registrar.models import *
import logging
logger = logging.getLogger("kpcc_backroom_handshakes")
class ContestTestCase(TestCase):
"""
a series of reusable methods we'll need for downloading and movin... | {
"repo_name": "SCPR/kpcc_backroom_handshakes",
"path": "ballot_box/test_utils_import.py",
"copies": "1",
"size": "1648",
"license": "mit",
"hash": 1277384725445979400,
"line_mean": 23.9696969697,
"line_max": 76,
"alpha_frac": 0.5558252427,
"autogenerated": false,
"ratio": 3.6379690949227372,
"c... |
from django.test import TestCase
from django.conf import settings
from datetime import datetime, timedelta
from restclients.exceptions import DataFailureException
from restclients.sws.term import get_term_by_year_and_quarter,\
get_term_before, get_term_after, get_current_term, get_next_term,\
get_previous_term,... | {
"repo_name": "uw-it-cte/uw-restclients",
"path": "restclients/test/sws/term.py",
"copies": "2",
"size": "23886",
"license": "apache-2.0",
"hash": -3745875326252321000,
"line_mean": 43.1515711645,
"line_max": 79,
"alpha_frac": 0.5465544671,
"autogenerated": false,
"ratio": 3.9383347073371806,
"... |
from django.test import TestCase
from django.conf import settings
from django.contrib.auth import get_user_model
from django.test.client import Client
from milkman.dairy import milkman
from userroles.models import set_user_role, UserRole
from userroles.utils import SettingsTestCase
from userroles import roles, Roles, R... | {
"repo_name": "laginha/django-user-roles",
"path": "src/userroles/tests.py",
"copies": "1",
"size": "4224",
"license": "mit",
"hash": -6721382198057742000,
"line_mean": 39.2285714286,
"line_max": 89,
"alpha_frac": 0.5977746212,
"autogenerated": false,
"ratio": 3.7546666666666666,
"config_test":... |
from django.test import TestCase
from django.conf import settings
from django.contrib.auth.models import SiteProfileNotAvailable
from userena.utils import (get_gravatar, signin_redirect, get_profile_model,
get_protocol, get_user_model)
from userena import settings as userena_settings
from us... | {
"repo_name": "joeyjy/ayi-django",
"path": "ms/userena/tests/tests_utils.py",
"copies": "2",
"size": "3226",
"license": "mit",
"hash": -2014630099512596700,
"line_mean": 37.4047619048,
"line_max": 82,
"alpha_frac": 0.5809051457,
"autogenerated": false,
"ratio": 4.524544179523142,
"config_test":... |
from django.test import TestCase
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured
from post.models import Post
from social import models
from social.models import SocialObjectP... | {
"repo_name": "praekelt/panya-social",
"path": "social/tests.py",
"copies": "2",
"size": "6290",
"license": "bsd-3-clause",
"hash": 8166360725640758000,
"line_mean": 53.224137931,
"line_max": 159,
"alpha_frac": 0.7015898251,
"autogenerated": false,
"ratio": 3.8447432762836184,
"config_test": tr... |
from django.test import TestCase
from django.conf import settings
from django.contrib.auth.models import User, Permission, ContentType
from common.models import Project, Settings
from testreport.models import TestPlan
from testreport.models import Launch
from testreport.models import Build
from testreport.models impor... | {
"repo_name": "2gis/badger-api",
"path": "cdws_api/tests.py",
"copies": "1",
"size": "76050",
"license": "mit",
"hash": -318638492956567800,
"line_mean": 40.4893617021,
"line_max": 79,
"alpha_frac": 0.5684286654,
"autogenerated": false,
"ratio": 3.970242756460454,
"config_test": true,
"has_no... |
from django.test import TestCase
from django.conf import settings
from django.contrib.gis.geos import LineString, Polygon, MultiPolygon
from geotrek.core.models import Topology
from geotrek.core.factories import PathFactory
from geotrek.land.tests.test_views import EdgeHelperTest
from geotrek.zoning.models import City... | {
"repo_name": "camillemonchicourt/Geotrek",
"path": "geotrek/zoning/tests/test_models.py",
"copies": "1",
"size": "7328",
"license": "bsd-2-clause",
"hash": 7668561255949748000,
"line_mean": 42.619047619,
"line_max": 90,
"alpha_frac": 0.6241812227,
"autogenerated": false,
"ratio": 3.3863216266173... |
from django.test import TestCase
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from app_metrics.utils import *
class MixpanelMetricConfigTests(TestCase):
def setUp(self):
self.old_backend = settings.APP_METRICS_BACKEND
settings.APP_METRICS_BACKEND = 'app... | {
"repo_name": "frankwiles/django-app-metrics",
"path": "app_metrics/tests/mixpanel_tests.py",
"copies": "4",
"size": "1029",
"license": "bsd-3-clause",
"hash": 7513310398790954000,
"line_mean": 31.15625,
"line_max": 70,
"alpha_frac": 0.7162293489,
"autogenerated": false,
"ratio": 3.92748091603053... |
from django.test import TestCase
from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from mdot_rest.models import *
from PIL import Image
import os
import random
ALPHA = "abcdefghijklmnopqrstuvwxyz "
TESTROOT = os.path.abspath(os.path.dirname(__file__))
class ImageTest(Test... | {
"repo_name": "uw-it-aca/mdot-rest",
"path": "mdot_rest/test/image.py",
"copies": "1",
"size": "1385",
"license": "apache-2.0",
"hash": 1097752243159302700,
"line_mean": 31.9761904762,
"line_max": 79,
"alpha_frac": 0.6397111913,
"autogenerated": false,
"ratio": 3.7032085561497325,
"config_test"... |
from django.test import TestCase
from django.conf import settings
from django.core import mail
from django.core.management import call_command
from kong.models import Test, Site, TestResult
from kong.utils import execute_test, _send_error
class BasicTests(TestCase):
fixtures = ['test_data.json']
def setUp(s... | {
"repo_name": "ericholscher/django-kong",
"path": "kong/tests/model_tests.py",
"copies": "1",
"size": "3768",
"license": "mit",
"hash": 5025802139576520000,
"line_mean": 30.4,
"line_max": 117,
"alpha_frac": 0.6066878981,
"autogenerated": false,
"ratio": 3.9414225941422596,
"config_test": true,
... |
from django.test import TestCase
from django.conf import settings
from django.core.management import call_command
from cla_common.constants import DIAGNOSIS_SCOPE, MATTER_TYPE_LEVELS
from legalaid.models import Category, MatterType
from diagnosis.graph import get_graph
from diagnosis.utils import get_node_scope_value
... | {
"repo_name": "ministryofjustice/cla_backend",
"path": "cla_backend/apps/diagnosis/tests/test_graph.py",
"copies": "1",
"size": "4609",
"license": "mit",
"hash": 7081034853852845000,
"line_mean": 44.1862745098,
"line_max": 222,
"alpha_frac": 0.6081579518,
"autogenerated": false,
"ratio": 3.896027... |
from django.test import TestCase
from django.conf import settings
from django.core.urlresolvers import reverse
from lrs import models, views
import datetime
from django.utils.timezone import utc
from django.utils import timezone
import hashlib
import urllib
import os
import json
import base64
import ast
import uuid
cl... | {
"repo_name": "varunasingh/ADL_LRS",
"path": "lrs/tests/ActivityStateTests.py",
"copies": "2",
"size": "39216",
"license": "apache-2.0",
"hash": 1205139366361373200,
"line_mean": 57.0118343195,
"line_max": 208,
"alpha_frac": 0.6534577723,
"autogenerated": false,
"ratio": 3.3304458598726114,
"co... |
from django.test import TestCase
from django.conf import settings
from django.http import HttpResponse
from unittest.mock import MagicMock
from unittest.mock import patch
from meetup.services.http_client import HttpClient
from pizzaplace.models import PizzaPlace
from pizzaplace.services.yelp_url_builder import YelpUr... | {
"repo_name": "nicole-a-tesla/meetup.pizza",
"path": "pizzaplace/tests/test_services.py",
"copies": "1",
"size": "3429",
"license": "mit",
"hash": 4578668562281737000,
"line_mean": 39.6785714286,
"line_max": 91,
"alpha_frac": 0.7582674861,
"autogenerated": false,
"ratio": 3.1727019498607243,
"c... |
from django.test import TestCase
from django.conf import settings
from django_jsx.template.backend import JsTemplate
from django_jsx.template.loaders import JsLoader
class FakeRequest():
def __init__(self):
self.META = {}
@property
def path(self):
return '/'
def build_absolute_uri(se... | {
"repo_name": "jonashagstedt/django-jsx",
"path": "tests/test_template.py",
"copies": "2",
"size": "1306",
"license": "bsd-3-clause",
"hash": 8527075864545761000,
"line_mean": 30.8536585366,
"line_max": 107,
"alpha_frac": 0.6424196018,
"autogenerated": false,
"ratio": 4.226537216828479,
"config... |
from django.test import TestCase
from django.conf import settings
from django.test.client import Client
from django.core.urlresolvers import reverse
from unittest2 import skipIf
from myuw.test.api import missing_url, get_user, get_user_pass
from myuw.models import UserMigrationPreference
from django.test.utils import o... | {
"repo_name": "fanglinfang/myuw",
"path": "myuw/test/views/mobile_login.py",
"copies": "1",
"size": "9797",
"license": "apache-2.0",
"hash": -2910053303583174000,
"line_mean": 41.7816593886,
"line_max": 79,
"alpha_frac": 0.6413187711,
"autogenerated": false,
"ratio": 3.844976452119309,
"config_... |
from django.test import TestCase
from django.conf import settings
from django.test.client import Client
import json
newt_base_url = "/api"
try:
from local_settings import test_login as login
except ImportError:
login = {"username": "nimonly", "password": "testpassword"}
class MyTestClient(Client):
def req... | {
"repo_name": "NERSC/newt-2.0",
"path": "newt/tests.py",
"copies": "3",
"size": "1695",
"license": "bsd-2-clause",
"hash": 444694359597426200,
"line_mean": 32.2549019608,
"line_max": 82,
"alpha_frac": 0.6289085546,
"autogenerated": false,
"ratio": 4.035714285714286,
"config_test": true,
"has_... |
from django.test import TestCase
from django.conf import settings
from django.test.client import RequestFactory
from psycopg2 import OperationalError
from nose.tools import eq_, ok_
class ViewsPages(TestCase):
def _get_handler500(self):
root_urlconf = __import__(settings.ROOT_URLCONF,
... | {
"repo_name": "chirilo/airmozilla",
"path": "airmozilla/base/tests/test_views.py",
"copies": "15",
"size": "2289",
"license": "bsd-3-clause",
"hash": 5093274667760197000,
"line_mean": 41.3888888889,
"line_max": 77,
"alpha_frac": 0.6339012669,
"autogenerated": false,
"ratio": 4.47945205479452,
"... |
from django.test import TestCase
from django.conf import settings
from django.utils.html import escape
from django.template import Context, Template
from bongo.apps.bongo.tests import factories
def render_template(string, context=None):
context = Context(context) if context else None
return Template(string).r... | {
"repo_name": "BowdoinOrient/bongo",
"path": "bongo/apps/frontend/tests/templatetags_tests.py",
"copies": "1",
"size": "1164",
"license": "mit",
"hash": 9162725913018718000,
"line_mean": 29.6315789474,
"line_max": 76,
"alpha_frac": 0.6194158076,
"autogenerated": false,
"ratio": 4.674698795180723,... |
from django.test import TestCase
from django.conf import settings
from django.utils import timezone as tz
from django.utils import dateparse
import mock
from msgvis.apps.datatable import models
from msgvis.apps.corpus import models as corpus_models
from msgvis.apps.dimensions.models import CategoricalDimension
from ms... | {
"repo_name": "hds-lab/textvisdrg",
"path": "msgvis/apps/datatable/tests.py",
"copies": "1",
"size": "23208",
"license": "mit",
"hash": -5057941583957506000,
"line_mean": 39.2218370884,
"line_max": 118,
"alpha_frac": 0.6374526026,
"autogenerated": false,
"ratio": 4.369798531350028,
"config_test... |
from django.test import TestCase
from django.conf import settings
from django.utils.timezone import now
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from image.models import ImageRequest, ImageOffer
from image.forms import ImageRequestForm, ImageOfferForm
class ImageModelTe... | {
"repo_name": "buddylindsey/photo-blogger",
"path": "image/tests.py",
"copies": "1",
"size": "3443",
"license": "bsd-2-clause",
"hash": -8987229938635346000,
"line_mean": 31.4811320755,
"line_max": 95,
"alpha_frac": 0.6430438571,
"autogenerated": false,
"ratio": 3.834075723830735,
"config_test"... |
from django.test import TestCase
from django.conf import settings
from isomorphic.template.backend import JsTemplate
from isomorphic.template.loaders import JsLoader
class FakeRequest():
def __init__(self):
self.META = {}
@property
def path(self):
return '/'
def build_absolute_uri(se... | {
"repo_name": "wildfish/django-isomorphic",
"path": "tests/test_template.py",
"copies": "1",
"size": "1306",
"license": "bsd-3-clause",
"hash": 3717063807302532000,
"line_mean": 30.8536585366,
"line_max": 107,
"alpha_frac": 0.6439509954,
"autogenerated": false,
"ratio": 4.254071661237785,
"conf... |
from django.test import TestCase
from django.conf import settings
from modelmanager.uriconfigure import *
from modelmanager.models import ContentModel, ModelVersion
from utils import create_dummy_files
from uriredirect.models import RewriteRule
def generate_content_model():
"""Function to generate an example Conte... | {
"repo_name": "usgin/modelmanager",
"path": "tests/uriconfigure.py",
"copies": "1",
"size": "7163",
"license": "bsd-3-clause",
"hash": -854621776180299900,
"line_mean": 50.9130434783,
"line_max": 145,
"alpha_frac": 0.6641072176,
"autogenerated": false,
"ratio": 3.9949804796430564,
"config_test"... |
from django.test import TestCase
from django.conf import settings
from .models import GmapsPlace, GmapsItem
from gmaps import Geocoding
# from gmaps.errors import RateLimitExceeded
import json
class GmapsPlacesTest(TestCase):
@classmethod
def setUpClass(cls):
location1 = GmapsPlace(
addre... | {
"repo_name": "20tab/twentytab-gmaps-places",
"path": "gmaps_places/tests.py",
"copies": "1",
"size": "6010",
"license": "mit",
"hash": -7153290742891145000,
"line_mean": 39.8843537415,
"line_max": 154,
"alpha_frac": 0.640765391,
"autogenerated": false,
"ratio": 3.3112947658402203,
"config_test... |
from django.test import TestCase
from django.conf import settings
from restclients.bookstore import Bookstore
from restclients.sws import SWS
from unittest2 import skipIf
from restclients.sws.term import get_current_term
from restclients.sws.registration import get_schedule_by_regid_and_term
class BookstoreScheduleTes... | {
"repo_name": "jeffFranklin/uw-restclients",
"path": "restclients/test/book/by_schedule.py",
"copies": "1",
"size": "3123",
"license": "apache-2.0",
"hash": -8381423642892619000,
"line_mean": 41.7808219178,
"line_max": 151,
"alpha_frac": 0.6637848223,
"autogenerated": false,
"ratio": 3.5569476082... |
from django.test import TestCase
from django.conf import settings
from restclients.canvas.admins import Admins
from restclients.exceptions import DataFailureException
class CanvasTestAdmins(TestCase):
def test_admins(self):
with self.settings(
RESTCLIENTS_CANVAS_DAO_CLASS='restclients.dao_i... | {
"repo_name": "uw-it-cte/uw-restclients",
"path": "restclients/test/canvas/admins.py",
"copies": "5",
"size": "1516",
"license": "apache-2.0",
"hash": 1781732971154036000,
"line_mean": 37.8717948718,
"line_max": 105,
"alpha_frac": 0.6569920844,
"autogenerated": false,
"ratio": 3.818639798488665,
... |
from django.test import TestCase
from django.conf import settings
from restclients.canvas.enrollments import Enrollments
from restclients.exceptions import DataFailureException
from restclients.models.canvas import CanvasEnrollment
class CanvasTestEnrollment(TestCase):
def test_enrollments_for_course_id(self):
... | {
"repo_name": "uw-it-cte/uw-restclients",
"path": "restclients/test/canvas/enrollments.py",
"copies": "4",
"size": "3928",
"license": "apache-2.0",
"hash": 4468067327188262000,
"line_mean": 48.7215189873,
"line_max": 137,
"alpha_frac": 0.6708248473,
"autogenerated": false,
"ratio": 3.740952380952... |
from django.test import TestCase
from django.conf import settings
from restclients.canvas.quizzes import Quizzes
from restclients.exceptions import DataFailureException
class CanvasTestQuizzes(TestCase):
def test_quizzes_by_course_id(self):
with self.settings(
RESTCLIENTS_CANVAS_DAO_CLASS='... | {
"repo_name": "jeffFranklin/uw-restclients",
"path": "restclients/test/canvas/quizzes.py",
"copies": "5",
"size": "1567",
"license": "apache-2.0",
"hash": 7236941856645873000,
"line_mean": 43.7714285714,
"line_max": 91,
"alpha_frac": 0.5462667518,
"autogenerated": false,
"ratio": 4.16755319148936... |
from django.test import TestCase
from django.conf import settings
from restclients.canvas.roles import Roles
from restclients.exceptions import DataFailureException
class CanvasTestRoles(TestCase):
def test_roles(self):
with self.settings(
RESTCLIENTS_CANVAS_DAO_CLASS='restclients.dao_imp... | {
"repo_name": "uw-it-cte/uw-restclients",
"path": "restclients/test/canvas/roles.py",
"copies": "4",
"size": "1692",
"license": "apache-2.0",
"hash": -5697618556321347000,
"line_mean": 35.7826086957,
"line_max": 92,
"alpha_frac": 0.6317966903,
"autogenerated": false,
"ratio": 4.157248157248158,
... |
from django.test import TestCase
from django.conf import settings
from restclients.dao import PWS_DAO
from restclients.mock_http import MockHTTP
from restclients.cache_implementation import ETagCache
import re
class ETagCacheTest(TestCase):
def test_etags(self):
with self.settings(RESTCLIENTS_PWS_DAO_CLASS... | {
"repo_name": "uw-it-aca/uw-restclients",
"path": "restclients/test/cache/etag.py",
"copies": "5",
"size": "1616",
"license": "apache-2.0",
"hash": 3462645571015333000,
"line_mean": 34.1304347826,
"line_max": 102,
"alpha_frac": 0.6014851485,
"autogenerated": false,
"ratio": 4.252631578947368,
"... |
from django.test import TestCase
from django.conf import settings
from restclients.exceptions import DataFailureException
from restclients.dao_implementation.mock import convert_to_platform_safe
class TestMock(TestCase):
def test_convert_to_platform_safe(self):
name = "service/accounts.asmx/CreateEditor?N... | {
"repo_name": "jeffFranklin/uw-restclients",
"path": "restclients/test/dao_implementation/mock.py",
"copies": "3",
"size": "1664",
"license": "apache-2.0",
"hash": -2158731428963304000,
"line_mean": 46.5428571429,
"line_max": 124,
"alpha_frac": 0.6604567308,
"autogenerated": false,
"ratio": 3.617... |
from django.test import TestCase
from django.conf import settings
from restclients.exceptions import DataFailureException
from restclients.digitlib.curric import get_subject_guide
class DigitLibTest(TestCase):
def test_subject_guide(self):
with self.settings(
RESTCLIENTS_DIGITLIB_DAO_CLASS='re... | {
"repo_name": "jeffFranklin/uw-restclients",
"path": "restclients/test/digitlib/curric.py",
"copies": "2",
"size": "1122",
"license": "apache-2.0",
"hash": 5075166775532723000,
"line_mean": 43.88,
"line_max": 91,
"alpha_frac": 0.6131907308,
"autogenerated": false,
"ratio": 4.065217391304348,
"c... |
from django.test import TestCase
from django.conf import settings
from restclients.exceptions import DataFailureException
from restclients.models.trumba import is_view_permission,\
is_showon_permission, is_edit_permission, is_publish_permission,\
is_higher_permission
import restclients.trumba.calendar as Calend... | {
"repo_name": "uw-it-cte/uw-restclients",
"path": "restclients/test/trumba/calendars.py",
"copies": "2",
"size": "9183",
"license": "apache-2.0",
"hash": -6196288078135991000,
"line_mean": 44.4603960396,
"line_max": 148,
"alpha_frac": 0.5635413264,
"autogenerated": false,
"ratio": 4.0886019590382... |
from django.test import TestCase
from django.conf import settings
from restclients.gws import GWS
from restclients.models.gws import Group, GroupUser, GroupMember
from restclients.exceptions import DataFailureException
class GWSGroupBasics(TestCase):
def test_get_nonexistant_group(self):
with self.settings... | {
"repo_name": "jeffFranklin/uw-restclients",
"path": "restclients/test/gws/group.py",
"copies": "3",
"size": "5025",
"license": "apache-2.0",
"hash": 7828238104261905000,
"line_mean": 46.4056603774,
"line_max": 116,
"alpha_frac": 0.5385074627,
"autogenerated": false,
"ratio": 4.184013322231474,
... |
from django.test import TestCase
from django.conf import settings
from restclients.models import ClassSchedule, Term, Section, Person
from myuw.dao.course_color import get_colors_by_regid_and_schedule
from myuw.dao.schedule import _get_schedule
FDAO_SWS = 'restclients.dao_implementation.sws.File'
class TestCourseCo... | {
"repo_name": "fanglinfang/myuw",
"path": "myuw/test/dao/course_color.py",
"copies": "1",
"size": "15972",
"license": "apache-2.0",
"hash": 3133072435422020600,
"line_mean": 32.1369294606,
"line_max": 79,
"alpha_frac": 0.6119459053,
"autogenerated": false,
"ratio": 3.9060895084372707,
"config_t... |
from django.test import TestCase
from django.conf import settings
from restclients.models.sws import ClassSchedule, Term, Section, Person
from myuw.dao.schedule import _get_schedule,\
has_summer_quarter_section, filter_schedule_sections_by_summer_term
FDAO_SWS = 'restclients.dao_implementation.sws.File'
FDAO_PWS ... | {
"repo_name": "fanglinfang/myuw",
"path": "myuw/test/dao/schedule.py",
"copies": "1",
"size": "2588",
"license": "apache-2.0",
"hash": -3634729710838383000,
"line_mean": 39.4375,
"line_max": 71,
"alpha_frac": 0.5803709428,
"autogenerated": false,
"ratio": 3.729106628242075,
"config_test": true,... |
from django.test import TestCase
from django.conf import settings
from restclients.models.sws import Term, Curriculum, Person
from restclients.exceptions import DataFailureException
from restclients.exceptions import InvalidSectionID, InvalidSectionURL
from restclients.exceptions import InvalidCanvasIndependentStudyCou... | {
"repo_name": "jeffFranklin/uw-restclients",
"path": "restclients/test/sws/section.py",
"copies": "1",
"size": "19649",
"license": "apache-2.0",
"hash": -1540192065494690000,
"line_mean": 47.5160493827,
"line_max": 124,
"alpha_frac": 0.5941778208,
"autogenerated": false,
"ratio": 3.92822870851659... |
from django.test import TestCase
from django.conf import settings
from restclients.nws import NWS
from restclients.exceptions import DataFailureException, InvalidUUID, InvalidNetID
from vm.v1.viewmodels import Channel, Endpoint, Subscription
from unittest2 import skip, skipIf
class NWSTestSubscription(TestCase):
... | {
"repo_name": "uw-it-aca/uw-restclients",
"path": "restclients/test/nws/subscription.py",
"copies": "1",
"size": "10301",
"license": "apache-2.0",
"hash": 8959681268752766000,
"line_mean": 47.1355140187,
"line_max": 133,
"alpha_frac": 0.6529463159,
"autogenerated": false,
"ratio": 3.8180133432171... |
from django.test import TestCase
from django.conf import settings
from restclients.nws import NWS
from restclients.exceptions import DataFailureException
from restclients.models import CourseAvailableEvent
from vm.v1.viewmodels import Message, MessageList, Serializer
from unittest2 import skipIf
class NWSTestMessage(... | {
"repo_name": "UWIT-IAM/uw-restclients",
"path": "restclients/test/nws/message.py",
"copies": "4",
"size": "6462",
"license": "apache-2.0",
"hash": 2429054972621044000,
"line_mean": 41.5131578947,
"line_max": 109,
"alpha_frac": 0.548901269,
"autogenerated": false,
"ratio": 4.334004024144869,
"c... |
from django.test import TestCase
from django.conf import settings
from restclients.nws import NWS
from restclients.exceptions import DataFailureException
from vm.v1.viewmodels import Endpoint
class NWSTestEndpoint(TestCase):
def _assert_endpoint_matches(self, endpoint):
self.assertEquals('780f2a49-2118-49... | {
"repo_name": "uw-it-cte/uw-restclients",
"path": "restclients/test/nws/endpoint.py",
"copies": "4",
"size": "2677",
"license": "apache-2.0",
"hash": -3459958737350601700,
"line_mean": 43.6166666667,
"line_max": 114,
"alpha_frac": 0.6608143444,
"autogenerated": false,
"ratio": 3.662106703146375,
... |
from django.test import TestCase
from django.conf import settings
from restclients.pws import PWS
from restclients.exceptions import InvalidRegID, InvalidNetID, DataFailureException
class PWSTestEntityData(TestCase):
def test_by_regid(self):
with self.settings(
RESTCLIENTS_PWS_DAO_CLASS='r... | {
"repo_name": "uw-it-cte/uw-restclients",
"path": "restclients/test/pws/entity.py",
"copies": "1",
"size": "3220",
"license": "apache-2.0",
"hash": 4486096319811281000,
"line_mean": 43.7222222222,
"line_max": 85,
"alpha_frac": 0.6040372671,
"autogenerated": false,
"ratio": 3.6674259681093395,
"... |
from django.test import TestCase
from django.conf import settings
from restclients.r25.events import get_event_by_id, get_events
from restclients.exceptions import DataFailureException
from unittest2 import skipIf
class R25TestEvents(TestCase):
def test_event_by_id(self):
with self.settings(
... | {
"repo_name": "uw-it-cte/uw-restclients",
"path": "restclients/test/r25/events.py",
"copies": "5",
"size": "3026",
"license": "apache-2.0",
"hash": 1431829297904394800,
"line_mean": 42.2285714286,
"line_max": 89,
"alpha_frac": 0.6245869134,
"autogenerated": false,
"ratio": 3.7404202719406676,
"... |
from django.test import TestCase
from django.conf import settings
from restclients.sws.notice import get_notices_by_regid
from datetime import date, datetime, timedelta
class SWSNotice(TestCase):
def test_notice_resource(self):
with self.settings(
RESTCLIENTS_SWS_DAO_CLASS='restclients.dao_... | {
"repo_name": "jeffFranklin/uw-restclients",
"path": "restclients/test/sws/notice.py",
"copies": "1",
"size": "5669",
"license": "apache-2.0",
"hash": -4594665075222463500,
"line_mean": 45.4672131148,
"line_max": 85,
"alpha_frac": 0.6149232669,
"autogenerated": false,
"ratio": 4.150073206442167,
... |
from django.test import TestCase
from django.conf import settings
from restclients.sws.person import get_person_by_regid
import datetime
class PersonTest(TestCase):
def test_person_resource(self):
with self.settings(
RESTCLIENTS_SWS_DAO_CLASS='restclients.dao_implementation.sws.File',
... | {
"repo_name": "UWIT-IAM/uw-restclients",
"path": "restclients/test/sws/person.py",
"copies": "5",
"size": "5948",
"license": "apache-2.0",
"hash": -8839308032754113000,
"line_mean": 54.5887850467,
"line_max": 91,
"alpha_frac": 0.6592131809,
"autogenerated": false,
"ratio": 3.7597977243994944,
"... |
from django.test import TestCase
from django.conf import settings
from restclients.uwnetid.subscription_60 import is_current_staff,\
is_current_faculty, get_kerberos_subs, is_current_clinician
from restclients.exceptions import DataFailureException
class KerberosSubsTest(TestCase):
def test_get_kerberos_subs... | {
"repo_name": "uw-it-cte/uw-restclients",
"path": "restclients/test/uwnetid/subscription_60.py",
"copies": "1",
"size": "2370",
"license": "apache-2.0",
"hash": 8677336266333581000,
"line_mean": 37.8524590164,
"line_max": 66,
"alpha_frac": 0.605907173,
"autogenerated": false,
"ratio": 4.150612959... |
from django.test import TestCase
from django.conf import settings
from tests.utils import unload_django_ses
class SettingsImportTest(TestCase):
def test_aws_access_key_given(self):
settings.AWS_ACCESS_KEY_ID = "Yjc4MzQ4MGYzMTBhOWY3ODJhODhmNTBkN2QwY2IyZTdhZmU1NDM1ZQo"
settings.AWS_SECRET_ACCESS_KEY... | {
"repo_name": "django-ses/django-ses",
"path": "tests/test_settings.py",
"copies": "1",
"size": "1356",
"license": "mit",
"hash": 8965307743088470000,
"line_mean": 49.2222222222,
"line_max": 107,
"alpha_frac": 0.7463126844,
"autogenerated": false,
"ratio": 2.7505070993914806,
"config_test": tru... |
from django.test import TestCase
from django.conf import settings
import json
from mock import MagicMock, patch
from .jobs import collection_harvest, collection_stop
from .models import Collection, CollectionSet, Seed, Credential, Group, User, Harvest
from .rabbit import RabbitWorker
class StartJobsTests(TestCase):
... | {
"repo_name": "gwu-libraries/sfm",
"path": "sfm/ui/test_jobs.py",
"copies": "1",
"size": "13143",
"license": "mit",
"hash": -713732009288347100,
"line_mean": 52.2105263158,
"line_max": 117,
"alpha_frac": 0.6332648558,
"autogenerated": false,
"ratio": 4.08167701863354,
"config_test": true,
"ha... |
from django.test import TestCase
from django.conf import settings
import json
from newt.tests import MyTestClient, newt_base_url, login
class StoreTests(TestCase):
fixtures = ["test_fixture.json"]
def setUp(self):
self.client = MyTestClient()
# Hacky: Need to figure out a way around this...
... | {
"repo_name": "shreddd/newt-2.0",
"path": "store/tests.py",
"copies": "3",
"size": "7464",
"license": "bsd-2-clause",
"hash": -2481341917344028700,
"line_mean": 42.3953488372,
"line_max": 95,
"alpha_frac": 0.5892282958,
"autogenerated": false,
"ratio": 3.632116788321168,
"config_test": true,
... |
from django.test import TestCase
from django.conf import settings
from location_field.apps import DefaultConfig
from tests.models import Place
from tests.forms import LocationForm
from pyquery import PyQuery as pq
import json
import location_field
class LocationFieldTest(TestCase):
def test_plain(self):
... | {
"repo_name": "caioariede/django-location-field",
"path": "tests/test.py",
"copies": "1",
"size": "1682",
"license": "mit",
"hash": 3618242750608257500,
"line_mean": 27.5084745763,
"line_max": 73,
"alpha_frac": 0.6177170036,
"autogenerated": false,
"ratio": 3.8755760368663594,
"config_test": tr... |
from django.test import TestCase
from django.conf import settings
from models import GwoExperiment, GwoSection, GwoVariation
from websiteoptimizer import client
class gwoTest(TestCase):
"""
Tests for django-gwo
"""
experiment = {
'title': 'TestExperiment',
'experiment_type': 'Multivari... | {
"repo_name": "callowayproject/django-gwo",
"path": "gwo/tests.py",
"copies": "1",
"size": "1612",
"license": "apache-2.0",
"hash": -59934902697609770,
"line_mean": 31.9183673469,
"line_max": 97,
"alpha_frac": 0.58808933,
"autogenerated": false,
"ratio": 3.847255369928401,
"config_test": true,
... |
from django.test import TestCase
from django.conf import settings
from tests.models import Place
from tests.forms import LocationForm
from pyquery import PyQuery as pq
import json
class LocationFieldTest(TestCase):
def test_plain(self):
vals = {
'city': 'Bauru',
'location': '-22... | {
"repo_name": "voodmania/django-location-field",
"path": "tests/test.py",
"copies": "1",
"size": "1347",
"license": "mit",
"hash": 5574938075079528000,
"line_mean": 26.4897959184,
"line_max": 66,
"alpha_frac": 0.6161841128,
"autogenerated": false,
"ratio": 3.7005494505494507,
"config_test": tru... |
from django.test import TestCase
from django.conf import settings
from .text_viewer_tvof import TextViewerAPITvof
from django.http.request import HttpRequest
from . import utils
class XMLTests(TestCase):
def test_remove_xml_elements(self):
cases = [
[
'''<r>head<a>text</a>tai... | {
"repo_name": "kingsdigitallab/tvof-django",
"path": "tvof/text_viewer/tests.py",
"copies": "1",
"size": "3353",
"license": "mit",
"hash": 6260097156383787000,
"line_mean": 27.6581196581,
"line_max": 115,
"alpha_frac": 0.4858335819,
"autogenerated": false,
"ratio": 3.478215767634855,
"config_te... |
from django.test import TestCase
from django.conf import settings
from unittest import skipIf
from geotrek.infrastructure.factories import InfrastructureFactory
from geotrek.signage.factories import SignageFactory
from geotrek.maintenance.factories import InterventionFactory, ProjectFactory
from geotrek.core.factorie... | {
"repo_name": "GeotrekCE/Geotrek-admin",
"path": "geotrek/maintenance/tests/test_project.py",
"copies": "2",
"size": "5183",
"license": "bsd-2-clause",
"hash": 1141550271453344000,
"line_mean": 34.0202702703,
"line_max": 92,
"alpha_frac": 0.6691105537,
"autogenerated": false,
"ratio": 3.704789135... |
from django.test import TestCase
from django.contrib.admin.sites import AdminSite
from batch_apps.models import App, Day, Execution
from batch_apps.admin import AppAdmin, DayAdmin
import datetime
class MockRequest(object):
pass
request = MockRequest()
class AppAdminTest(TestCase):
def setUp(self):
... | {
"repo_name": "azam-a/batcher",
"path": "batch_apps/tests/test_admin.py",
"copies": "1",
"size": "1581",
"license": "mit",
"hash": 1733138628950401000,
"line_mean": 32.6382978723,
"line_max": 85,
"alpha_frac": 0.6919671094,
"autogenerated": false,
"ratio": 3.4671052631578947,
"config_test": tru... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from accounts.authentication import PasswordlessAuthenticationBackend
from accounts.models import Token
User = get_user_model()
class AuthenticationTest(TestCase):
def test_returns_None_if_no_such_token(self):
result = Passwor... | {
"repo_name": "PatrickLeonard/superlists",
"path": "accounts/tests/test_authentication.py",
"copies": "1",
"size": "1670",
"license": "mit",
"hash": 4157414862232789500,
"line_mean": 39.7317073171,
"line_max": 86,
"alpha_frac": 0.7047904192,
"autogenerated": false,
"ratio": 3.883720930232558,
"... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission, AnonymousUser
from django.contrib.contenttypes.models import ContentType
from wagtail.wagtailcore.permission_policies import (
BlanketPermissionPolicy, AuthenticationOnlyPermiss... | {
"repo_name": "davecranwell/wagtail",
"path": "wagtail/wagtailcore/tests/test_permission_policies.py",
"copies": "2",
"size": "51258",
"license": "bsd-3-clause",
"hash": -1193385621940662300,
"line_mean": 36.2514534884,
"line_max": 98,
"alpha_frac": 0.5940731203,
"autogenerated": false,
"ratio": ... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from bestiary.models import Monster
from herders import models
User = get_user_model()
class RuneBuildModelTests(TestCase):
fixtures = ['test_summon_monsters']
def setUp(self):... | {
"repo_name": "PeteAndersen/swarfarm",
"path": "herders/tests/test_rune_builds.py",
"copies": "1",
"size": "8241",
"license": "apache-2.0",
"hash": -1655929015717670100,
"line_mean": 37.1527777778,
"line_max": 71,
"alpha_frac": 0.634267686,
"autogenerated": false,
"ratio": 3.7171853856562924,
"... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from curriculum.tests import factories
User = get_user_model()
class AdminExportResumeTest(TestCase):
def setUp(self):
self.user = User.objects.create(username='Mike', is_superuser... | {
"repo_name": "ZuluPro/django-cv",
"path": "curriculum/tests/test_admin.py",
"copies": "1",
"size": "1291",
"license": "bsd-3-clause",
"hash": 3067855701818983400,
"line_mean": 32.9736842105,
"line_max": 90,
"alpha_frac": 0.6134779241,
"autogenerated": false,
"ratio": 3.9240121580547114,
"confi... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.db.models.signals import post_save
from django.conf import settings
from rest_framework.test import APIClient
from english_diary.celery import app
from diaries.signals.post_save import post_save_diary
from diaries.models impor... | {
"repo_name": "jupiny/EnglishDiary",
"path": "english_diary/core/tests/base.py",
"copies": "1",
"size": "1232",
"license": "mit",
"hash": 5121672602792778000,
"line_mean": 24.6666666667,
"line_max": 59,
"alpha_frac": 0.661525974,
"autogenerated": false,
"ratio": 3.8864353312302837,
"config_test... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.test.utils import override_settings
from django.contrib.sites.models import Site
from allauth.socialaccount.models import SocialApp
from allauth.socialaccount.providers.facebook.provider import GRAPH_API_URL
import responses
f... | {
"repo_name": "caruccio/django-rest-auth",
"path": "rest_auth/tests/test_social.py",
"copies": "1",
"size": "4259",
"license": "mit",
"hash": -4040209837867488000,
"line_mean": 32.5354330709,
"line_max": 303,
"alpha_frac": 0.5938013618,
"autogenerated": false,
"ratio": 3.739244951712028,
"confi... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.utils import timezone
from surveys.models import Survey
"""
test_django-surveys
------------
Tests for `django-surveys` models module.
"""
class TestSurveys(TestCase):
def setUp(self):
self.user = get_user_mode... | {
"repo_name": "sebastian-code/django-surveys",
"path": "tests/test_models.py",
"copies": "1",
"size": "1537",
"license": "bsd-3-clause",
"hash": 961868571239619100,
"line_mean": 31.7021276596,
"line_max": 77,
"alpha_frac": 0.6161353286,
"autogenerated": false,
"ratio": 3.8233830845771144,
"conf... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from form_builder.tests.factories import FormF, FieldF
from django.core.urlresolvers import reverse
class PermissionsTest(TestCase):
fixtures = ['core-test-fixtures.json']
csrf_checks = False
@property
def user(self):
... | {
"repo_name": "cfpb/collab-form-builder",
"path": "src/form_builder/tests/view_tests.py",
"copies": "1",
"size": "1062",
"license": "cc0-1.0",
"hash": -5771383998669531000,
"line_mean": 32.1875,
"line_max": 73,
"alpha_frac": 0.6610169492,
"autogenerated": false,
"ratio": 3.649484536082474,
"con... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from jsonapi.api import API
from jsonapi.resource import Resource
from jsonapi.model_inspector import ModelInspector, Field
from ..models import (
AAbstractOne, AAbstractManyToMany, AAbstract, AA, AOne, AManyToMany,
A, B, BMany, BM... | {
"repo_name": "pavlov99/jsonapi",
"path": "tests/testapp/tests/test_model_relationship.py",
"copies": "1",
"size": "12329",
"license": "mit",
"hash": -2368876712295179300,
"line_mean": 41.8090277778,
"line_max": 79,
"alpha_frac": 0.5972098305,
"autogenerated": false,
"ratio": 3.6208516886930986,
... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from ..models.organization import ExternalOrgIdentifier
from ..models.party_types import ExternalIdentifierCodeList
from ..models.organization import Organization,OrganizationCodeList
__author__ = 'valentin'
class testExternalOrgIdentifi... | {
"repo_name": "hydroshare/hydroshare_temp",
"path": "hs_party/tests/testExternalOrgIdentifiers.py",
"copies": "1",
"size": "1465",
"license": "bsd-3-clause",
"hash": 44658910385157520,
"line_mean": 36.5641025641,
"line_max": 98,
"alpha_frac": 0.737883959,
"autogenerated": false,
"ratio": 4.173789... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from ..accounts.tests import ManagerFactory
from ..buildings.tests import BuildingFactory
from .models import Notice
User = get_user_model()
class NoticeTests(TestCase):
def test_has_permission_if_manager(self):
building ... | {
"repo_name": "danjac/ownblock",
"path": "ownblock/ownblock/apps/notices/tests.py",
"copies": "1",
"size": "1338",
"license": "mit",
"hash": -5047458401165832000,
"line_mean": 35.1621621622,
"line_max": 72,
"alpha_frac": 0.6136023916,
"autogenerated": false,
"ratio": 4.401315789473684,
"config_... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from django_sonic_screwdriver.apps.ban.models import UserBan, IPBan
User = get_user_model()
class AppBanTest(TestCase):
def test_user_ban_create(self):
user = User.objects.create(username="test", password="123")
User... | {
"repo_name": "rhazdon/django-sonic-screwdriver",
"path": "tests/test_app_ban.py",
"copies": "1",
"size": "1239",
"license": "mit",
"hash": -6376643399173116000,
"line_mean": 34.4,
"line_max": 71,
"alpha_frac": 0.6553672316,
"autogenerated": false,
"ratio": 3.286472148541114,
"config_test": tru... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from experiments.models import Experiment, ENABLED_STATE
from experiments.signals import user_enrolled
from experiments.utils import participant
EXPERIMENT_NAME = 'backgroundcolor'
class WatchSignal(object):
def __init__(self, signa... | {
"repo_name": "mixcloud/django-experiments",
"path": "experiments/tests/test_signals.py",
"copies": "5",
"size": "1400",
"license": "mit",
"hash": 8221099171908106000,
"line_mean": 32.3333333333,
"line_max": 94,
"alpha_frac": 0.6785714286,
"autogenerated": false,
"ratio": 3.835616438356164,
"co... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from filebrowser.conf import fb_settings
from PIL import Image, ImageDraw
import os
class BaseTestCase(TestCase):
"""
Base class with user creation, etc
"""
def setUp(self):
user_model = get_user_model()
... | {
"repo_name": "scream4ik/django-media-manager",
"path": "filebrowser/tests/base.py",
"copies": "2",
"size": "1397",
"license": "bsd-3-clause",
"hash": 8555469323692785000,
"line_mean": 32.2619047619,
"line_max": 76,
"alpha_frac": 0.5497494631,
"autogenerated": false,
"ratio": 3.7756756756756755,
... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from unittest.mock import Mock
from treatment_sheets.forms import TxSheetForm, TxItemForm
from treatment_sheets.models import TxSheet, TxItem, Prescription
User = get_user_model()
class TxSheetFormTest(TestCase):
def test_form_val... | {
"repo_name": "onnudilol/vetcalc",
"path": "treatment_sheets/tests/test_forms.py",
"copies": "1",
"size": "2079",
"license": "mit",
"hash": -5595491204038373000,
"line_mean": 26.3552631579,
"line_max": 77,
"alpha_frac": 0.557960558,
"autogenerated": false,
"ratio": 3.5783132530120483,
"config_t... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from userena.backends import UserenaAuthenticationBackend
User = get_user_model()
class UserenaAuthenticationBackendTests(TestCase):
"""
Test the ``UserenaAuthenticationBackend`` which should return a ``User``
when supplied ... | {
"repo_name": "bread-and-pepper/django-userena",
"path": "userena/tests/test_backends.py",
"copies": "5",
"size": "2580",
"license": "bsd-3-clause",
"hash": -7928677951565255000,
"line_mean": 37.5074626866,
"line_max": 93,
"alpha_frac": 0.5914728682,
"autogenerated": false,
"ratio": 4.81343283582... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from wafer.tickets.views import import_ticket
from wafer.tickets.models import Ticket, TicketType
class ImportTicketTests(TestCase):
def setUp(self):
self.user_email = "user@example.com"
def create_user(self, email, user... | {
"repo_name": "CarlFK/wafer",
"path": "wafer/tickets/tests/test_views.py",
"copies": "1",
"size": "2257",
"license": "isc",
"hash": -2389179090475128000,
"line_mean": 42.4038461538,
"line_max": 78,
"alpha_frac": 0.6863092601,
"autogenerated": false,
"ratio": 3.7305785123966944,
"config_test": t... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from wagtail.wagtailcore.models import Page, UserPagePermissionsProxy
from wagtail.tests.models import EventPage
class TestPagePermission(TestCase):
fixtures = ['test.json']
def test_nonpublisher_page_permissions(self):
... | {
"repo_name": "timheap/wagtail",
"path": "wagtail/wagtailcore/tests/test_page_permissions.py",
"copies": "5",
"size": "16009",
"license": "bsd-3-clause",
"hash": -8401986855453335000,
"line_mean": 52.1860465116,
"line_max": 163,
"alpha_frac": 0.7052907739,
"autogenerated": false,
"ratio": 3.64089... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from wagtail.wagtailcore.models import Page, UserPagePermissionsProxy
from wagtail.tests.testapp.models import EventPage
class TestPagePermission(TestCase):
fixtures = ['test.json']
def test_nonpublisher_page_permissions(self):
... | {
"repo_name": "hanpama/wagtail",
"path": "wagtail/wagtailcore/tests/test_page_permissions.py",
"copies": "26",
"size": "17276",
"license": "bsd-3-clause",
"hash": -2023471838203988200,
"line_mean": 50.8798798799,
"line_max": 163,
"alpha_frac": 0.7036929845,
"autogenerated": false,
"ratio": 3.6370... |
from django.test import TestCase
from django.contrib.auth import get_user_model
class TestPost(TestCase):
def setUp(self):
self.test_username = "test_user"
self.test_userpassword = "test_password"
user = self.user = get_user_model().objects.create_user(
username=self.test_use... | {
"repo_name": "LeoHeo/fastube",
"path": "fastube/posts/tests/test_modules/test_post.py",
"copies": "1",
"size": "1114",
"license": "mit",
"hash": -708574075490998500,
"line_mean": 26.0256410256,
"line_max": 69,
"alpha_frac": 0.564516129,
"autogenerated": false,
"ratio": 3.055072463768116,
"conf... |
from django.test import TestCase
from django.contrib.auth import models
from .models import Photos, Album
import factory
class UserFactory(factory.DjangoModelFactory):
class Meta:
model = models.User
django_get_or_create = ('username',)
username = 'Photo_Maker_mcCoolGuy'
class PhotoFactory(f... | {
"repo_name": "HeyIamJames/django-imager",
"path": "imagersite/photo/tests.py",
"copies": "1",
"size": "1376",
"license": "mit",
"hash": -6961709270157257000,
"line_mean": 24.0181818182,
"line_max": 56,
"alpha_frac": 0.6715116279,
"autogenerated": false,
"ratio": 3.865168539325843,
"config_test... |
from django.test import TestCase
from django.contrib.auth.mixins import LoginRequiredMixin
import datetime
from django.utils import timezone
from catalog.models import BookInstance, Book, Genre, Language
from django.contrib.auth.models import User #Required to assign User as a borrower
# Create your tests here.
from... | {
"repo_name": "escottgoodwin/djangolocallibrary",
"path": "tests/test_views.py",
"copies": "1",
"size": "12320",
"license": "mit",
"hash": -3009467008107138600,
"line_mean": 46.2030651341,
"line_max": 163,
"alpha_frac": 0.6698863636,
"autogenerated": false,
"ratio": 3.680908276068121,
"config_t... |
from django.test import TestCase
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import PermissionDenied
from geokey.users.tests.model_factories import UserF, UserGroupF
from .model_factories import ProjectF
from ..models import Project
class ProjectListTest(TestCase):
def setUp... | {
"repo_name": "nagyistoce/geokey",
"path": "geokey/projects/tests/test_manager.py",
"copies": "1",
"size": "11255",
"license": "apache-2.0",
"hash": -1473382796103974000,
"line_mean": 33.2097264438,
"line_max": 71,
"alpha_frac": 0.5262549978,
"autogenerated": false,
"ratio": 4.413725490196079,
... |
from django.test import TestCase
from django.contrib.auth.models import AnonymousUser
from rest_framework.test import APIRequestFactory
from api.address import ResidentialAddressViewSet
# Test double for geocode function: always returns the same point
def mock_geocode(postcode, sleep):
return {
'wgs84_lon... | {
"repo_name": "chris48s/UK-Polling-Stations",
"path": "polling_stations/apps/api/tests/test_address.py",
"copies": "1",
"size": "2059",
"license": "bsd-3-clause",
"hash": 5864379494326533000,
"line_mean": 39.3725490196,
"line_max": 80,
"alpha_frac": 0.6779990287,
"autogenerated": false,
"ratio": ... |
from django.test import TestCase
from django.contrib.auth.models import AnonymousUser
from rest_framework.test import APIRequestFactory
from api.postcode import PostcodeViewSet
from data_finder.helpers import MultipleCouncilsException
"""
Test double for geocode function
allows us to use fake postcodes and return kno... | {
"repo_name": "chris48s/UK-Polling-Stations",
"path": "polling_stations/apps/api/tests/test_postcode.py",
"copies": "1",
"size": "4178",
"license": "bsd-3-clause",
"hash": 1475731430892366600,
"line_mean": 35.9734513274,
"line_max": 80,
"alpha_frac": 0.6407371948,
"autogenerated": false,
"ratio":... |
from django.test import TestCase
from django.contrib.auth.models import AnonymousUser
from geokey.users.tests.model_factories import UserF
from geokey.contributions.tests.model_factories import ObservationFactory
from .model_factories import ProjectF
from ..serializers import ProjectSerializer
class SerializerTest(... | {
"repo_name": "nagyistoce/geokey",
"path": "geokey/projects/tests/test_serializers.py",
"copies": "1",
"size": "1441",
"license": "apache-2.0",
"hash": 2279822488162494700,
"line_mean": 35.9487179487,
"line_max": 73,
"alpha_frac": 0.6981263012,
"autogenerated": false,
"ratio": 4.489096573208723,
... |
from django.test import TestCase
from django.contrib.auth.models import Group
from django.contrib.auth.models import User
from django.urls import reverse
from urllib.parse import urlparse
from urllib.parse import parse_qsl
from http import HTTPStatus
class AdminTestCase(TestCase):
@classmethod
def setUpTestDat... | {
"repo_name": "rstens/gwells",
"path": "gwells/test_admin.py",
"copies": "1",
"size": "4311",
"license": "apache-2.0",
"hash": -3405682273042800600,
"line_mean": 32.6796875,
"line_max": 95,
"alpha_frac": 0.6532127117,
"autogenerated": false,
"ratio": 3.894308943089431,
"config_test": true,
"h... |
from django.test import TestCase
from django.contrib.auth.models import Group
from django.core.exceptions import PermissionDenied
from hs_access_control.models import \
UserResourceProvenance, UserResourcePrivilege, \
GroupResourceProvenance, GroupResourcePrivilege, \
UserGroupProvenance, UserGroupPrivileg... | {
"repo_name": "RENCI/xDCIShare",
"path": "hs_access_control/tests/test_provenance_units.py",
"copies": "2",
"size": "33828",
"license": "bsd-3-clause",
"hash": -1764699998821151000,
"line_mean": 36.7544642857,
"line_max": 93,
"alpha_frac": 0.6029029207,
"autogenerated": false,
"ratio": 3.82194102... |
from django.test import TestCase
from django.contrib.auth.models import Group
from django.core.exceptions import PermissionDenied
from hs_access_control.models import PrivilegeCodes, GroupCommunityPrivilege,\
GroupCommunityProvenance, UserCommunityPrivilege, UserCommunityProvenance, \
GroupResourcePriv... | {
"repo_name": "hydroshare/hydroshare",
"path": "hs_access_control/tests/test_communities.py",
"copies": "1",
"size": "27674",
"license": "bsd-3-clause",
"hash": 5044530487349252000,
"line_mean": 50.43866171,
"line_max": 100,
"alpha_frac": 0.6308809713,
"autogenerated": false,
"ratio": 3.745804006... |
from django.test import TestCase
from django.contrib.auth.models import Group
from django.core.exceptions import PermissionDenied
from hs_access_control.models import UserResourceProvenance, UserResourcePrivilege, \
GroupResourceProvenance, GroupResourcePrivilege, \
UserGroupProvenance, UserGroupPrivilege, \
... | {
"repo_name": "hydroshare/hydroshare",
"path": "hs_access_control/tests/test_undo.py",
"copies": "1",
"size": "60169",
"license": "bsd-3-clause",
"hash": 7825914372262496000,
"line_mean": 34.9217910448,
"line_max": 93,
"alpha_frac": 0.568797886,
"autogenerated": false,
"ratio": 4.185087292202824,... |
from django.test import TestCase
from django.contrib.auth.models import Group
from django.core.exceptions import PermissionDenied
from hs_core import hydroshare
class TestUpdateGroupAPI(TestCase):
def setUp(self):
self.group, _ = Group.objects.get_or_create(name='Hydroshare Author')
self.john_gro... | {
"repo_name": "hydroshare/hydroshare",
"path": "hs_core/tests/api/native/test_update_group.py",
"copies": "2",
"size": "2286",
"license": "bsd-3-clause",
"hash": -2420677627677578000,
"line_mean": 41.3333333333,
"line_max": 96,
"alpha_frac": 0.6391076115,
"autogenerated": false,
"ratio": 4.024647... |
from django.test import TestCase
from django.contrib.auth.models import Group
from django.db.utils import IntegrityError
from mediaviewer.models.usersettings import (UserSettings,
case_insensitive_authenticate,
)
from mediaviewer.... | {
"repo_name": "kyokley/MediaViewer",
"path": "mediaviewer/tests/models/test_usersettings.py",
"copies": "1",
"size": "9495",
"license": "mit",
"hash": 8324416347661526000,
"line_mean": 38.0740740741,
"line_max": 121,
"alpha_frac": 0.566192733,
"autogenerated": false,
"ratio": 4.647577092511013,
... |
from django.test import TestCase
from django.contrib.auth.models import Group
from hs_access_control.models import PrivilegeCodes
from hs_core import hydroshare
from hs_core.models import GenericResource
from hs_core.testing import MockIRODSTestCaseMixin
from hs_access_control.tests.utilities import global_reset, is... | {
"repo_name": "FescueFungiShare/hydroshare",
"path": "hs_access_control/tests/test_create_resource.py",
"copies": "1",
"size": "24563",
"license": "bsd-3-clause",
"hash": -7015255371174997000,
"line_mean": 37.9270998415,
"line_max": 81,
"alpha_frac": 0.6134022717,
"autogenerated": false,
"ratio":... |
from django.test import TestCase
from django.contrib.auth.models import Group
from hs_access_control.models import PrivilegeCodes
from hs_core import hydroshare
from hs_core.testing import MockIRODSTestCaseMixin
from hs_access_control.tests.utilities import global_reset, is_equal_to_as_set
class UnitTests(MockIROD... | {
"repo_name": "FescueFungiShare/hydroshare",
"path": "hs_access_control/tests/test_units.py",
"copies": "2",
"size": "24184",
"license": "bsd-3-clause",
"hash": -4303482009937182700,
"line_mean": 34.775147929,
"line_max": 79,
"alpha_frac": 0.5714521998,
"autogenerated": false,
"ratio": 3.49277874... |
from django.test import TestCase
from django.contrib.auth.models import Group
from hs_access_control.models import UserAccess, GroupAccess, ResourceAccess, \
UserGroupPrivilege, UserResourcePrivilege, GroupMembershipRequest
from hs_core import hydroshare
from hs_core.models import BaseResource
from hs_core.testin... | {
"repo_name": "RENCI/xDCIShare",
"path": "hs_access_control/tests/test_user_delete.py",
"copies": "2",
"size": "4691",
"license": "bsd-3-clause",
"hash": -5993594125118115000,
"line_mean": 38.0916666667,
"line_max": 92,
"alpha_frac": 0.630569175,
"autogenerated": false,
"ratio": 4.047454702329595... |
from django.test import TestCase
from django.contrib.auth.models import Group
from hs_access_control.models import UserResourceProvenance, UserResourcePrivilege, \
GroupResourceProvenance, GroupResourcePrivilege, \
UserGroupProvenance, UserGroupPrivilege, \
PrivilegeCodes
from hs_core import hydroshare
fr... | {
"repo_name": "hydroshare/hydroshare",
"path": "hs_access_control/tests/test_provenance_function.py",
"copies": "1",
"size": "58015",
"license": "bsd-3-clause",
"hash": 4470911547710374000,
"line_mean": 34.8559950556,
"line_max": 93,
"alpha_frac": 0.5651124709,
"autogenerated": false,
"ratio": 4.... |
from django.test import TestCase
from django.contrib.auth.models import Group
from hs_core import hydroshare
from hs_core.testing import MockIRODSTestCaseMixin
from hs_access_control.tests.utilities import global_reset
class T15CreateGroup(MockIRODSTestCaseMixin, TestCase):
"Test creatng a group"
def setUp... | {
"repo_name": "hydroshare/hydroshare",
"path": "hs_access_control/tests/test_create_group_2.py",
"copies": "2",
"size": "4692",
"license": "bsd-3-clause",
"hash": -3238096292194810000,
"line_mean": 37.1463414634,
"line_max": 77,
"alpha_frac": 0.655370844,
"autogenerated": false,
"ratio": 3.640031... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.