text stringlengths 0 1.05M | meta dict |
|---|---|
from django.test import TestCase
from django.core.urlresolvers import reverse
from openbudgets.apps.accounts.factories import Account
from openbudgets.apps.entities.factories import Entity
from openbudgets.apps.contexts.factories import Context
from openbudgets.apps.sheets.factories import Sheet
class InteractionTest... | {
"repo_name": "openbudgets/openbudgets",
"path": "openbudgets/apps/interactions/tests.py",
"copies": "3",
"size": "3312",
"license": "bsd-3-clause",
"hash": -6032904741269946000,
"line_mean": 47,
"line_max": 78,
"alpha_frac": 0.6911231884,
"autogenerated": false,
"ratio": 4.14,
"config_test": t... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from package.models import Project
import feedparser
from feeds.tests import data
class LatestFeedsTest(TestCase):
def setUp(self):
data.load()
def test_latest_feeds(self):
packages = Project.objects.all().order_... | {
"repo_name": "noisy/steemprojects.com",
"path": "feeds/tests/test_latest.py",
"copies": "1",
"size": "1172",
"license": "mit",
"hash": -7929910247505449000,
"line_mean": 31.5555555556,
"line_max": 92,
"alpha_frac": 0.6450511945,
"autogenerated": false,
"ratio": 4.156028368794326,
"config_test"... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from tweet.models import Tweet
class TweetTest(TestCase):
def setUp(self):
self.tweet = Tweet.objects.create(text='Test tweet')
Tweet.objects.create(text='Another tweet')
def test_list_tweets(self):
url = r... | {
"repo_name": "jaimebuelta/django-docker-template",
"path": "src/tweet/tests.py",
"copies": "1",
"size": "1220",
"license": "mit",
"hash": -7833647284057890000,
"line_mean": 31.1052631579,
"line_max": 66,
"alpha_frac": 0.612295082,
"autogenerated": false,
"ratio": 4.0131578947368425,
"config_te... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from vehicles.models import Category, VehicleMake, Vehicle
from vehicles.context_processor import ContactDetail, Social
class ProjectTests(TestCase):
def setUp(self):
self.main_category = Category.objects.create(
ca... | {
"repo_name": "sitture/trade-motors",
"path": "src/gp_cars/tests/test_urls.py",
"copies": "1",
"size": "4188",
"license": "mit",
"hash": 6869221537882494000,
"line_mean": 29.1294964029,
"line_max": 66,
"alpha_frac": 0.5630372493,
"autogenerated": false,
"ratio": 4.251776649746193,
"config_test"... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from vendor.xapi.lrs import views, models
from vendor.xapi.oauth_provider.oauth.oauth import OAuthRequest, OAuthSignatureMethod_HMAC_SHA1
from django.test.utils import setup_test_environment
from django.contrib.auth.models import User
from ve... | {
"repo_name": "Nuevosmedios/ADL_LRS",
"path": "lrs/tests/OAuthTests.py",
"copies": "1",
"size": "72278",
"license": "apache-2.0",
"hash": -2290695141498040300,
"line_mean": 53.5082956259,
"line_max": 184,
"alpha_frac": 0.6370264811,
"autogenerated": false,
"ratio": 3.763107200499818,
"config_te... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from whats_fresh.whats_fresh_api.models import Preparation
from django.contrib.auth.models import User, Group
class EditPreparationTestCase(TestCase):
"""
Test that the Edit Preparation page works as expected.
Things tested:
... | {
"repo_name": "iCHAIT/whats-fresh-api",
"path": "whats_fresh/whats_fresh_api/tests/views/entry/test_edit_preparation.py",
"copies": "2",
"size": "3196",
"license": "apache-2.0",
"hash": -7683435929836659000,
"line_mean": 33,
"line_max": 79,
"alpha_frac": 0.6157697121,
"autogenerated": false,
"rat... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from whats_fresh.whats_fresh_api.models import (Product, Image, Story,
Preparation)
from django.contrib.auth.models import User, Group
class InlineProductTestCase(TestCase):
"""
Test ... | {
"repo_name": "osu-cass/whats-fresh-api",
"path": "whats_fresh/whats_fresh_api/tests/views/entry/test_inline_product.py",
"copies": "2",
"size": "5139",
"license": "apache-2.0",
"hash": -2121702847054800000,
"line_mean": 38.8372093023,
"line_max": 79,
"alpha_frac": 0.5911655964,
"autogenerated": fa... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from whats_fresh.whats_fresh_api.models import Story
from django.contrib.auth.models import User, Group
class EditStoryTestCase(TestCase):
"""
Test that the Edit Story page works as expected.
Things tested:
URLs revers... | {
"repo_name": "iCHAIT/whats-fresh-api",
"path": "whats_fresh/whats_fresh_api/tests/views/entry/test_edit_story.py",
"copies": "2",
"size": "3566",
"license": "apache-2.0",
"hash": 8599514890732671000,
"line_mean": 32.0185185185,
"line_max": 73,
"alpha_frac": 0.565619742,
"autogenerated": false,
"... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from whats_fresh.whats_fresh_api.models import (Vendor, ProductPreparation,
Product, Preparation, Story)
from django.contrib.auth.models import User, Group
from whats_fresh.whats_fresh_api.templ... | {
"repo_name": "iCHAIT/whats-fresh-api",
"path": "whats_fresh/whats_fresh_api/tests/views/entry/test_new_vendor.py",
"copies": "2",
"size": "9123",
"license": "apache-2.0",
"hash": 7939507031744753000,
"line_mean": 40.2805429864,
"line_max": 79,
"alpha_frac": 0.5961854653,
"autogenerated": false,
... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from whats_fresh.whats_fresh_api.models import Vendor, Story
from django.contrib.auth.models import User, Group
class EditVendorTestCase(TestCase):
"""
Test that the Edit Vendor page works as expected.
Things tested:
U... | {
"repo_name": "osu-cass/whats-fresh-api",
"path": "whats_fresh/whats_fresh_api/tests/views/entry/test_edit_vendor.py",
"copies": "2",
"size": "4871",
"license": "apache-2.0",
"hash": 7655759641450437000,
"line_mean": 35.6240601504,
"line_max": 79,
"alpha_frac": 0.5963867789,
"autogenerated": false,... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from working_waterfronts.working_waterfronts_api.models import Hazard
from django.contrib.auth.models import User
class EditHazardTestCase(TestCase):
"""
Test that the Edit Hazard page works as expected.
Things tested:
... | {
"repo_name": "osu-cass/working-waterfronts-api",
"path": "working_waterfronts/working_waterfronts_api/tests/views/entry/test_edit_hazards.py",
"copies": "1",
"size": "2943",
"license": "apache-2.0",
"hash": 2151292524718792400,
"line_mean": 31.3406593407,
"line_max": 74,
"alpha_frac": 0.5936119606,
... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from working_waterfronts.working_waterfronts_api.models import Image
from django.contrib.auth.models import User
class ListImageTestCase(TestCase):
fixtures = ['thirtythree']
def setUp(self):
user = User.objects.create_user... | {
"repo_name": "osu-cass/working-waterfronts-api",
"path": "working_waterfronts/working_waterfronts_api/tests/views/entry/test_list_images.py",
"copies": "1",
"size": "2374",
"license": "apache-2.0",
"hash": 3570542792412586000,
"line_mean": 32.9142857143,
"line_max": 77,
"alpha_frac": 0.598146588,
... |
from django.test import TestCase
from django.core.urlresolvers import reverse
# http://www.django-rest-framework.org/api-guide/status-codes/#status-codes
from rest_framework import status
from .models import *
from .utils import to_json
class IndexViewTests(TestCase):
def test_index_view_is_working(self):
... | {
"repo_name": "nejads/carreg",
"path": "carreg_app/tests.py",
"copies": "2",
"size": "4273",
"license": "mit",
"hash": 3351640765847930000,
"line_mean": 44.9462365591,
"line_max": 79,
"alpha_frac": 0.5331149076,
"autogenerated": false,
"ratio": 4.364657814096017,
"config_test": true,
"has_no_... |
from django.test import TestCase
from django.core.urlresolvers import reverse
import datetime
import json
from mapstory.tests import MapStoryTestMixin, AdminClient
from .models import Location,LocationName
from skosxl.models import Notation, Concept
class GazTest(TestCase):
fixtures = ['gaz_featuretypes_skos.jso... | {
"repo_name": "rob-metalinkage/django-gazetteer",
"path": "gazetteer/tests.py",
"copies": "1",
"size": "6819",
"license": "cc0-1.0",
"hash": 2636772540873833000,
"line_mean": 46.6923076923,
"line_max": 160,
"alpha_frac": 0.5833699956,
"autogenerated": false,
"ratio": 4.032525133057362,
"config_... |
from django.test import TestCase
from django.core.urlresolvers import reverse
import json
class LocationsTestCase(TestCase):
fixtures = ["real_data"]
def setUp(self):
self.maxDiff = None
self.expected_json = """
{
"error": {
"status": false,
"name": null,
"text": null,
"debu... | {
"repo_name": "osu-cass/whats-fresh-api",
"path": "whats_fresh/whats_fresh_api/tests/views/test_locations.py",
"copies": "2",
"size": "1141",
"license": "apache-2.0",
"hash": -81515204575537540,
"line_mean": 19.375,
"line_max": 58,
"alpha_frac": 0.5433829974,
"autogenerated": false,
"ratio": 3.69... |
from django.test import TestCase
from django.core.urlresolvers import reverse
import urllib
from application.models import Application, AuthorizationCode
from user_profile.models import UserProfile
from django.contrib.auth.models import User
import urlparse
import json
class OAuthv2TestCase(TestCase):
def setUp(s... | {
"repo_name": "agiliq/join.agiliq.com",
"path": "application/tests.py",
"copies": "1",
"size": "12529",
"license": "bsd-3-clause",
"hash": 4583825193607365600,
"line_mean": 51.6428571429,
"line_max": 79,
"alpha_frac": 0.502115093,
"autogenerated": false,
"ratio": 4.822555812163203,
"config_test... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from classifieds.tests.test_views import FancyTestCase
class TestAdBrowsing(FancyTestCase):
fixtures = ['users', 'categories', 'ads']
def setUp(self):
self.client.login(username='user', password='user')
def test_view_... | {
"repo_name": "saebyn/django-classifieds",
"path": "classifieds/tests/test_views/test_browse.py",
"copies": "1",
"size": "1658",
"license": "bsd-3-clause",
"hash": 6605249538121162000,
"line_mean": 37.5581395349,
"line_max": 79,
"alpha_frac": 0.6863691194,
"autogenerated": false,
"ratio": 3.44698... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from corehq.apps.domain.models import Domain
from corehq.apps.users.models import WebUser, CommCareUser
from ..forms import AuthenticateAsForm
from ..views import AuthenticateAs
class AuthenticateAsFormTest(TestCase):
@classmethod
... | {
"repo_name": "puttarajubr/commcare-hq",
"path": "corehq/apps/hqadmin/tests/test_authenticate_as.py",
"copies": "1",
"size": "3578",
"license": "bsd-3-clause",
"hash": -1480065500077866800,
"line_mean": 31.2342342342,
"line_max": 101,
"alpha_frac": 0.6240916713,
"autogenerated": false,
"ratio": 3... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth import get_user_model
from django.core import signing
from django.conf import settings
User = get_user_model()
REGISTRATION_SALT = getattr(settings, 'REGISTRATION_SALT',
'rest_framework_... | {
"repo_name": "9gix/django-rest-framework-registration",
"path": "tests/test_views.py",
"copies": "1",
"size": "1910",
"license": "isc",
"hash": 6507452527401440000,
"line_mean": 31.9310344828,
"line_max": 79,
"alpha_frac": 0.6445026178,
"autogenerated": false,
"ratio": 4.263392857142857,
"conf... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.db.models import signals
from aggregator.models import Service, Layer
from aggregator.models import layer_post_save, service_post_save
SERVICE_NUMBER = 2
LAYER_PER_SERVICE_NUMBER = 2
TIMES_TO_CHECK = 1
class PageRendererTest... | {
"repo_name": "jmwenda/hypermap",
"path": "hypermap/aggregator/tests/test_page_render.py",
"copies": "1",
"size": "2361",
"license": "mit",
"hash": -3931699097054464500,
"line_mean": 32.2535211268,
"line_max": 78,
"alpha_frac": 0.5705209657,
"autogenerated": false,
"ratio": 4.1276223776223775,
... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.db.models import signals
from hypermap.aggregator.models import Service, Layer, Catalog
from hypermap.aggregator.models import layer_post_save, service_post_save
SERVICE_NUMBER = 2
LAYER_PER_SERVICE_NUMBER = 2
TIMES_TO_CHECK =... | {
"repo_name": "cga-harvard/hypermap",
"path": "hypermap/aggregator/tests/test_page_render.py",
"copies": "2",
"size": "2671",
"license": "mit",
"hash": 4459421669373132000,
"line_mean": 33.2435897436,
"line_max": 85,
"alpha_frac": 0.5735679521,
"autogenerated": false,
"ratio": 4.1734375,
"confi... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from django_webtest import WebTest
from _1327.main.models import UserProfile
from _1327.information_pages.models import Document
class TestDocument(TestCase):
def setUp(self):
self.user = UserProfile.objects.create_user(username="tes... | {
"repo_name": "janno42/1327",
"path": "_1327/information_pages/tests.py",
"copies": "2",
"size": "2142",
"license": "mit",
"hash": -7963376603081879000,
"line_mean": 26.4615384615,
"line_max": 116,
"alpha_frac": 0.7240896359,
"autogenerated": false,
"ratio": 3.2259036144578315,
"config_test": t... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from .models import Article, Alias
from .test_utils import NewArticleMixin, NewAliasMixin
from common.test_utils import UserMixin
class HomePageViewTestCase(TestCase):
"""Testing the HomePageView"""
def test_response(self):
... | {
"repo_name": "art-solopov/mdwiki",
"path": "wiki/tests_unit_views.py",
"copies": "1",
"size": "2939",
"license": "mit",
"hash": -4292093896992287000,
"line_mean": 34.4096385542,
"line_max": 77,
"alpha_frac": 0.6233412725,
"autogenerated": false,
"ratio": 4.127808988764045,
"config_test": true,... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from .templatetags import article_tags
from .models import Article
class ArticleModelTests(TestCase):
def test_save(self):
article = Article(title='Single One', summary='', body='Content')
article.save()
self.a... | {
"repo_name": "zniper/simple-article",
"path": "article/tests.py",
"copies": "1",
"size": "1778",
"license": "mit",
"hash": 5892028804646850000,
"line_mean": 25.9393939394,
"line_max": 73,
"alpha_frac": 0.6473565804,
"autogenerated": false,
"ratio": 3.933628318584071,
"config_test": true,
"ha... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from testing_utils import AccountUserTestingMixin
class AccountUnauthViewTest(TestCase, AccountUserTestingMixin):
"""
For unauthenticated users.
Verify GET requests on all views. This does not cover updates via POST
reques... | {
"repo_name": "aptivate/django-organizations",
"path": "tests/tests/views.py",
"copies": "1",
"size": "5464",
"license": "bsd-2-clause",
"hash": 8190896165411031000,
"line_mean": 34.4805194805,
"line_max": 74,
"alpha_frac": 0.6557467057,
"autogenerated": false,
"ratio": 3.942279942279942,
"conf... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from testing_utils import AccountUserTestingMixin
class BaseAccountUnauthViewTest(AccountUserTestingMixin, TestCase):
"""
Ensure all views require logged in users
"""
def setUp(self):
self.get_fixtures()
def te... | {
"repo_name": "aptivate/django-organizations",
"path": "tests/tests/base.py",
"copies": "1",
"size": "8619",
"license": "bsd-2-clause",
"hash": -1753196640146164200,
"line_mean": 39.4647887324,
"line_max": 78,
"alpha_frac": 0.6438101868,
"autogenerated": false,
"ratio": 4.027570093457944,
"conf... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from tsuru_autoscale.datasource.forms import DataSourceForm
from tsuru_autoscale.datasource import client
import httpretty
import mock
import os
class RemoveTestCase(TestCase):
@mock.patch("tsuru_autoscale.datasource.client.list")
... | {
"repo_name": "tsuru/tsuru-autoscale-dashboard",
"path": "tsuru_autoscale/datasource/tests.py",
"copies": "1",
"size": "4585",
"license": "bsd-3-clause",
"hash": 5179904968462555000,
"line_mean": 30.6206896552,
"line_max": 88,
"alpha_frac": 0.6150490731,
"autogenerated": false,
"ratio": 3.7830033... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from user.models import User
from user.forms import AddUserForm
class ViewTests(TestCase):
def test_detail_view(self):
user = User.objects.create(
birthday='2000-12-12', email='a@o2.pl', username='a')
respo... | {
"repo_name": "MateuszG/django-user-example",
"path": "user/tests.py",
"copies": "1",
"size": "1702",
"license": "mit",
"hash": 4232928208299370500,
"line_mean": 33.7346938776,
"line_max": 75,
"alpha_frac": 0.5587544066,
"autogenerated": false,
"ratio": 3.765486725663717,
"config_test": true,
... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from wagtail.tests.utils import WagtailTestUtils
from wagtail.wagtailsearch import models
class TestEditorsPicks(TestCase):
def test_editors_pick_create(self):
# Create an editors pick to the root page
models.EditorsPic... | {
"repo_name": "lojack/wagtail",
"path": "wagtail/wagtailsearch/tests/test_editorspicks.py",
"copies": "19",
"size": "13070",
"license": "bsd-3-clause",
"hash": 4893695056064193000,
"line_mean": 41.0257234727,
"line_max": 145,
"alpha_frac": 0.6304514155,
"autogenerated": false,
"ratio": 3.64778118... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from wagtail.tests.utils import WagtailTestUtils
from wagtail.wagtailsearch.models import Query
from wagtail.contrib.wagtailsearchpromotions.models import SearchPromotion
from wagtail.contrib.wagtailsearchpromotions.templatetags.wagtailsearc... | {
"repo_name": "serzans/wagtail",
"path": "wagtail/contrib/wagtailsearchpromotions/tests.py",
"copies": "1",
"size": "13979",
"license": "bsd-3-clause",
"hash": -6248899798514040000,
"line_mean": 39.401734104,
"line_max": 116,
"alpha_frac": 0.6267973389,
"autogenerated": false,
"ratio": 3.76488015... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from wagtail.wagtailcore.models import Page
from wagtail.tests.models import SimplePage
from wagtail.tests.utils import WagtailTestUtils
class TestChooserBrowse(TestCase, WagtailTestUtils):
def setUp(self):
self.root_page = Pag... | {
"repo_name": "dresiu/wagtail",
"path": "wagtail/wagtailadmin/tests/test_page_chooser.py",
"copies": "2",
"size": "5506",
"license": "bsd-3-clause",
"hash": -8514344309737378000,
"line_mean": 36.9724137931,
"line_max": 98,
"alpha_frac": 0.6516527425,
"autogenerated": false,
"ratio": 3.93285714285... |
from django.test import TestCase
from django.core.urlresolvers import reverse
import json
class POIViewTestCase(TestCase):
fixtures = ['test_fixtures']
def setUp(self):
self.expected_poi = """
{
"error": {
"status": false,
"name": null,
"text": null,
"debug": null,
"level": nul... | {
"repo_name": "osu-cass/working-waterfronts-api",
"path": "working_waterfronts/working_waterfronts_api/tests/views/test_poi_detail_view.py",
"copies": "1",
"size": "2576",
"license": "apache-2.0",
"hash": 4806528211991664000,
"line_mean": 23.3018867925,
"line_max": 76,
"alpha_frac": 0.5535714286,
"... |
from django.test import TestCase
from django.core.urlresolvers import reverse
import project.settings as settings
from .usermixin import UserMixin
login_url = reverse(settings.LOGIN_URL)
class TestLogin(UserMixin, TestCase):
"""Test login view"""
def test_served(self):
"""Should serve login page"""
... | {
"repo_name": "wkevina/feature-requests-app",
"path": "features/tests/test_login.py",
"copies": "1",
"size": "1232",
"license": "mit",
"hash": 5995995824404942000,
"line_mean": 27.6511627907,
"line_max": 72,
"alpha_frac": 0.6371753247,
"autogenerated": false,
"ratio": 4.32280701754386,
"config_... |
from django.test import TestCase
from django.core.urlresolvers import reverse
SUCCESS_RESPONSE = b"""<?xml version="1.0"?>
<RealTimeResponse xmlns="T3MCallback">
<aggregator_identifier/>
<merchant_identifier>5567</merchant_identifier>
<merchant_order_ref>12345</merchant_order_ref>
<t3m_id>333333333</t3... | {
"repo_name": "django-oscar/django-oscar-datacash",
"path": "tests/the3rdman_callback_tests.py",
"copies": "1",
"size": "2135",
"license": "bsd-3-clause",
"hash": -7286594564212119000,
"line_mean": 37.8181818182,
"line_max": 83,
"alpha_frac": 0.706323185,
"autogenerated": false,
"ratio": 3.186567... |
from django.test import TestCase
from django.core.urlresolvers import reverse, resolve
from django.test.client import RequestFactory
from django.http import Http404
from contacts_and_people.models import (
Site, Person, Building, Entity, Membership
)
from contacts_and_people.views import contacts_and_people
fr... | {
"repo_name": "bubenkoff/Arkestra",
"path": "contacts_and_people/tests/contactsandpeople.py",
"copies": "1",
"size": "18350",
"license": "bsd-2-clause",
"hash": 6813767574507103000,
"line_mean": 32.2427536232,
"line_max": 84,
"alpha_frac": 0.5810354223,
"autogenerated": false,
"ratio": 4.07506107... |
from django.test import TestCase
from django.core.urlresolvers import reverse, resolve
from ..views import (
IndexPage,
ChecklistIndexUpdateItems,
ChecklistAddItem,
ChecklistDeleteItem,
ChecklistEditItem,
ChecklistEditItemVal,
ChecklistAddChecklist,
ChecklistDeleteChecklist,
Checkli... | {
"repo_name": "ExCiteS/geokey-checklist",
"path": "geokey_checklist/tests/test_urls.py",
"copies": "1",
"size": "5834",
"license": "mit",
"hash": 5357173716214773000,
"line_mean": 42.2148148148,
"line_max": 207,
"alpha_frac": 0.6444977717,
"autogenerated": false,
"ratio": 3.6439725171767647,
"c... |
from django.test import TestCase
from djangodash.models import *
from django.test.client import Client
from django.core.urlresolvers import reverse
class TestBase(TestCase):
"""
Base class for tests.
"""
def setUp(self):
self.user = User(username="test", password="!")
self.user.set_password("password")
self... | {
"repo_name": "noamsu/djangodash2012",
"path": "djangodash/tests.py",
"copies": "1",
"size": "9904",
"license": "mit",
"hash": 165106086833803260,
"line_mean": 27.7072463768,
"line_max": 72,
"alpha_frac": 0.6307552504,
"autogenerated": false,
"ratio": 3.423435879709644,
"config_test": true,
"... |
from django.test import TestCase
from django.db import connection
from django import forms
from django.utils import six
from boardinghouse.schema import (
activate_schema, deactivate_schema,
TemplateSchemaActivation,
is_shared_model,
get_active_schema_name,
get_schema_model,
activate_template_s... | {
"repo_name": "schinckel/django-boardinghouse",
"path": "tests/tests/test_schema_creation.py",
"copies": "1",
"size": "7871",
"license": "bsd-3-clause",
"hash": 846740056864068100,
"line_mean": 38.1592039801,
"line_max": 108,
"alpha_frac": 0.6427391691,
"autogenerated": false,
"ratio": 3.83764017... |
from django.test import TestCase
from django.db import connection
from django import forms
from boardinghouse.schema import (
activate_schema, deactivate_schema,
TemplateSchemaActivation,
is_shared_model,
get_active_schema_name,
get_schema_model,
activate_template_schema,
_get_search_path,
... | {
"repo_name": "luzfcb/django-boardinghouse",
"path": "tests/tests/test_schema_creation.py",
"copies": "1",
"size": "5779",
"license": "bsd-3-clause",
"hash": 602587671210467100,
"line_mean": 36.7712418301,
"line_max": 108,
"alpha_frac": 0.6490742343,
"autogenerated": false,
"ratio": 3.94470989761... |
from django.test import TestCase
from django.db import connection
from models import Unmanaged1, Unmanaged2, Managed1
from models import A01, A02, B01, B02, C01, C02
class SimpleTests(TestCase):
def test_simple(self):
"""
The main test here is that the all the models can be created without
... | {
"repo_name": "dvliman/jaikuengine",
"path": ".google_appengine/lib/django-1.2/tests/modeltests/unmanaged_models/tests.py",
"copies": "43",
"size": "2187",
"license": "apache-2.0",
"hash": -5822228236947279000,
"line_mean": 36.7068965517,
"line_max": 94,
"alpha_frac": 0.6291723823,
"autogenerated":... |
from django.test import TestCase
from django.db import connections
from salesforce.testrunner.example.models import User
from requests.exceptions import ConnectionError
class DynamicAuthTest(TestCase):
def assertConnectionProblem(self, queryset):
with self.assertRaises(Exception) as cm:
len(queryset)
exc = cm.... | {
"repo_name": "philchristensen/django-salesforce",
"path": "tests/test_dynamic_auth/tests.py",
"copies": "1",
"size": "1414",
"license": "mit",
"hash": -3796463749979993000,
"line_mean": 43.1875,
"line_max": 98,
"alpha_frac": 0.7652050919,
"autogenerated": false,
"ratio": 3.811320754716981,
"co... |
from django.test import TestCase
from django.db import IntegrityError
from django.core.exceptions import ValidationError
from django.db.models import Model
from address.models import *
from address.models import to_python
# Python 3 fixes.
import sys
if sys.version > '3':
long = int
basestring = (str, bytes)
... | {
"repo_name": "furious-luke/django-address",
"path": "address/tests/test_models.py",
"copies": "1",
"size": "14523",
"license": "bsd-3-clause",
"hash": -6522095930928929000,
"line_mean": 44.8138801262,
"line_max": 109,
"alpha_frac": 0.6308613923,
"autogenerated": false,
"ratio": 3.412359022556391... |
from django.test import TestCase
from django.db import IntegrityError
from django.core.exceptions import ValidationError
from django_google_dork.models import SearchEngine, Campaign, Dork, Run, Result
class TestCampaign(TestCase):
def setUp(self):
pass
def test_name_not_empty(self):
with sel... | {
"repo_name": "chgans/django-google-dork",
"path": "tests/test_models.py",
"copies": "1",
"size": "6956",
"license": "bsd-2-clause",
"hash": 6763606081954967000,
"line_mean": 35.6105263158,
"line_max": 79,
"alpha_frac": 0.5948821162,
"autogenerated": false,
"ratio": 3.6285863328116847,
"config_... |
from django.test import TestCase
from django.db import IntegrityError
from django.core.exceptions import ValidationError
from .models import Campaign, Dork, Run, Result
class TestCampaign(TestCase):
def setUp(self):
pass
def test_name_not_empty(self):
with self.assertRaises(ValidationError):... | {
"repo_name": "golgoth42/golgoth",
"path": "search/tests.py",
"copies": "1",
"size": "6154",
"license": "bsd-2-clause",
"hash": -8807078293376307000,
"line_mean": 33.5730337079,
"line_max": 66,
"alpha_frac": 0.5945726357,
"autogenerated": false,
"ratio": 3.6157461809635723,
"config_test": true,... |
from django.test import TestCase
from django.db import IntegrityError
from django.db.utils import DataError
from aggregator.models import Website, Language
import requests
class WebsiteTestCase(TestCase):
fixtures = ['language.json','website.json']
def setUp(self):
pass
def test_website_sends... | {
"repo_name": "olivmaurel/termsearch",
"path": "aggregator/tests/test_models.py",
"copies": "1",
"size": "1285",
"license": "apache-2.0",
"hash": -3297302928900025300,
"line_mean": 22.7962962963,
"line_max": 67,
"alpha_frac": 0.6544747082,
"autogenerated": false,
"ratio": 4.3120805369127515,
"c... |
from django.test import TestCase
from django.db import IntegrityError
from django.utils import timezone
from django.contrib.auth.models import User
from ostinato.blog.models import BlogEntryBase
from ..models import Entry
from .utils import create_objects
class BlogEntryBaseTestCase(TestCase):
def test_model_... | {
"repo_name": "andrewebdev/django-ostinato",
"path": "ostinato/tests/blog/tests/test_models.py",
"copies": "1",
"size": "1134",
"license": "mit",
"hash": 4375487933669540400,
"line_mean": 26,
"line_max": 71,
"alpha_frac": 0.6402116402,
"autogenerated": false,
"ratio": 4.123636363636364,
"config... |
from django.test import TestCase
from django.db import IntegrityError
from nose.tools import raises, assert_equals, assert_true, assert_is_not_none
from api.models import Element
from utils import factories
class ElementTest(TestCase):
def test_elements_required(self):
page = factories.PageFactory()
... | {
"repo_name": "SanaMobile/sana.protocol_builder",
"path": "src-django/api/tests/test_model_element.py",
"copies": "1",
"size": "5542",
"license": "bsd-3-clause",
"hash": -2171824725631298300,
"line_mean": 30.6685714286,
"line_max": 77,
"alpha_frac": 0.6158426561,
"autogenerated": false,
"ratio": ... |
from django.test import TestCase
from django.db import IntegrityError
from users.models import User
from profiles.models import GigSeeker, GigPoster
class TestGigSeeker(TestCase):
def setUp(self):
self.u = User.objects.create(username='myname',
email='me@me.com',
... | {
"repo_name": "aschn/goodtechgigs",
"path": "goodtechgigs/profiles/tests/test_models.py",
"copies": "1",
"size": "3294",
"license": "apache-2.0",
"hash": -715214740809650200,
"line_mean": 35.6,
"line_max": 99,
"alpha_frac": 0.6426836673,
"autogenerated": false,
"ratio": 3.5042553191489363,
"con... |
from django.test import TestCase
from django.db import IntegrityError
from hostproof_auth.models import *
from hostproof_auth.auth import ModelBackend
class ModelBackendTest(TestCase):
def setUp(self):
self.modelBackend = ModelBackend()
self.user = User.objects.create_user(username="john",
... | {
"repo_name": "jpintado/django-hostproof-auth",
"path": "hostproof_auth/tests/test_auth.py",
"copies": "1",
"size": "1204",
"license": "mit",
"hash": -8622974491296111000,
"line_mean": 35.4848484848,
"line_max": 77,
"alpha_frac": 0.6677740864,
"autogenerated": false,
"ratio": 4.151724137931034,
... |
from django.test import TestCase
from django.db import models, connection
from ..fields import JsonField, ImageField
# Without default
class SimpleModel(models.Model):
json = JsonField()
class Meta:
db_table = 'simple'
class SimpleCompactModel(models.Model):
json = JsonField(compact=True, defa... | {
"repo_name": "damianignacio/anima",
"path": "src/anima/tests/test_fields.py",
"copies": "1",
"size": "5109",
"license": "mit",
"hash": -7029687430416696000,
"line_mean": 27.8644067797,
"line_max": 83,
"alpha_frac": 0.5830886671,
"autogenerated": false,
"ratio": 4.0872,
"config_test": true,
"... |
from django.test import TestCase
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.template import Template, Context, TemplateSyntaxError
from positions.models import Position, PositionContent
from positions import settings
class SimpleText(models.Model):
"""A Tes... | {
"repo_name": "callowayproject/django-kamasutra",
"path": "positions/tests.py",
"copies": "1",
"size": "17939",
"license": "apache-2.0",
"hash": 6391068734864954000,
"line_mean": 47.75,
"line_max": 162,
"alpha_frac": 0.6357656503,
"autogenerated": false,
"ratio": 4.196257309941521,
"config_test... |
from django.test import TestCase
from django.db import models
from notifier.models import Notifier, get_date_method
from datetime import datetime, timedelta
class NotifierTestCase(TestCase):
def setUp(self):
# Should be a global
# We test Notifier ON ITSELF (crazy sounds)
self.kwargs = {... | {
"repo_name": "hwayne/safehouse",
"path": "notifier/tests/test_models.py",
"copies": "1",
"size": "4743",
"license": "apache-2.0",
"hash": -5905530208374041000,
"line_mean": 33.3695652174,
"line_max": 69,
"alpha_frac": 0.5072738773,
"autogenerated": false,
"ratio": 4.478753541076487,
"config_te... |
from django.test import TestCase
from django.db import models
from questionnaire.models import QuestionAnswer, AnswerSet, Question, QuestionGroup, Questionnaire, FIELD_TYPE_CHOICES, QuestionGroup_order, Question_order, CustomListField,\
LatestQuestionAnswer
from django.db.models.fields import CharField
from django.... | {
"repo_name": "UoK-Psychology/django-questionnaire",
"path": "questionnaire/tests/models.py",
"copies": "1",
"size": "28103",
"license": "mit",
"hash": -3150991423380293600,
"line_mean": 47.2058319039,
"line_max": 174,
"alpha_frac": 0.6358395901,
"autogenerated": false,
"ratio": 4.285953942351685... |
from django.test import TestCase
from django.db import models
from uppsell.workflow import Workflow, State, BadTransition, \
pre_transition_signal, post_transition_signal, \
pre_transition, post_transition
class ExampleModel(object):
test_state = 'A'
flag = 'RED'
def __init__(self):
... | {
"repo_name": "upptalk/uppsell",
"path": "uppsell/tests/test_workflow.py",
"copies": "1",
"size": "5415",
"license": "mit",
"hash": -4395314155279829000,
"line_mean": 36.6041666667,
"line_max": 92,
"alpha_frac": 0.5804247461,
"autogenerated": false,
"ratio": 3.9324618736383443,
"config_test": t... |
from django.test import TestCase
from django.db import models
from ostinato.statemachine import State, StateMachine
from ostinato.statemachine import (
InvalidState,
InvalidTransition,
InvalidStateMachine)
from ..workflow import *
from ..models import TestModel
class StateTestCase(TestCase):
def te... | {
"repo_name": "andrewebdev/django-ostinato",
"path": "ostinato/tests/statemachine/tests/test_statemachine.py",
"copies": "1",
"size": "6980",
"license": "mit",
"hash": 7396323075133429000,
"line_mean": 33.7263681592,
"line_max": 116,
"alpha_frac": 0.6259312321,
"autogenerated": false,
"ratio": 4.... |
from django.test import TestCase
from django.db import models
from ....product.models import ProductAbstract, Variant
from ....cart.models import Cart
from .models import VariantStockLevelMixin
# Models for tests
class StockedDeadParrot(ProductAbstract):
species = models.CharField(max_length=20)
class StockedDea... | {
"repo_name": "fusionbox/satchless",
"path": "satchless/contrib/stock/singlestore/tests.py",
"copies": "1",
"size": "1380",
"license": "bsd-3-clause",
"hash": 8914088080510984000,
"line_mean": 35.3157894737,
"line_max": 109,
"alpha_frac": 0.6942028986,
"autogenerated": false,
"ratio": 3.382352941... |
from django.test import TestCase
from django.db import transaction as db_transaction
from moneyed import Money
from hordak.models import Account, Transaction, Leg, StatementImport, StatementLine
from hordak.tests.utils import DataProvider, BalanceUtils
from hordak.utilities.currency import Balance
class InitialEquit... | {
"repo_name": "waldocollective/django-hordak",
"path": "hordak/tests/test_worked_examples.py",
"copies": "2",
"size": "14289",
"license": "mit",
"hash": 2901263691511391000,
"line_mean": 46.1584158416,
"line_max": 100,
"alpha_frac": 0.6665966828,
"autogenerated": false,
"ratio": 3.535131123206333... |
from django.test import TestCase
from django.db.migrations.graph import CircularDependencyError, MigrationGraph, NodeNotFoundError
from django.utils.encoding import force_text
class GraphTests(TestCase):
"""
Tests the digraph structure.
"""
def test_simple_graph(self):
"""
Tests a bas... | {
"repo_name": "edevil/django",
"path": "tests/migrations/test_graph.py",
"copies": "10",
"size": "10250",
"license": "bsd-3-clause",
"hash": 7216437955330736000,
"line_mean": 40.4979757085,
"line_max": 165,
"alpha_frac": 0.4994146341,
"autogenerated": false,
"ratio": 3.4132534132534134,
"config... |
from django.test import TestCase
from django.db.migrations.graph import MigrationGraph, CircularDependencyError
class GraphTests(TestCase):
"""
Tests the digraph structure.
"""
def test_simple_graph(self):
"""
Tests a basic dependency graph:
app_a: 0001 <-- 0002 <--- 0003 <-... | {
"repo_name": "jarvys/django-1.7-jdb",
"path": "tests/migrations/test_graph.py",
"copies": "1",
"size": "7318",
"license": "bsd-3-clause",
"hash": 6517590503790634000,
"line_mean": 41.3005780347,
"line_max": 165,
"alpha_frac": 0.4907078437,
"autogenerated": false,
"ratio": 3.4132462686567164,
"... |
from django.test import TestCase
from django.db.models import (CharField, TextField,
BooleanField, ForeignKey,
SmallIntegerField)
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from deck.models import Event, Pro... | {
"repo_name": "gtsalles/speakerfight",
"path": "deck/tests/test_unit.py",
"copies": "14",
"size": "14429",
"license": "mit",
"hash": -3309038779665168400,
"line_mean": 38.2092391304,
"line_max": 81,
"alpha_frac": 0.686187539,
"autogenerated": false,
"ratio": 3.6153846153846154,
"config_test": t... |
from django.test import TestCase
from django.db.models import Count
from tests.models import Book
from django_tabulate import tabulate_qs
class TabulateTests(TestCase):
def setUp(self):
Book.objects.create(name='Python')
Book.objects.create(name='Django')
Book.objects.create(name='Tabulate... | {
"repo_name": "todorvelichkov/django-tabulate",
"path": "tests/test_mixin.py",
"copies": "1",
"size": "1601",
"license": "mit",
"hash": -8961166429194887000,
"line_mean": 31.693877551,
"line_max": 66,
"alpha_frac": 0.3953778888,
"autogenerated": false,
"ratio": 4.213157894736842,
"config_test":... |
from django.test import TestCase
from django.db.models import Sum
import pandas as pd
import numpy as np
from .models import MyModel, Trader, Security, TradeLog, TradeLogNote, MyModelChoice, Portfolio
from django_pandas.io import read_frame
class IOTest(TestCase):
def setUp(self):
data = {
'c... | {
"repo_name": "sternb0t/django-pandas",
"path": "django_pandas/tests/test_io.py",
"copies": "1",
"size": "6824",
"license": "bsd-3-clause",
"hash": -6612535247158093000,
"line_mean": 40.6097560976,
"line_max": 95,
"alpha_frac": 0.5257913247,
"autogenerated": false,
"ratio": 3.541255838090296,
"... |
from django.test import TestCase
from django.db.models.manager import Manager
from django.core.exceptions import ImproperlyConfigured
from rest_framework import serializers
from drf_nested_resource.utils import (
find_child_to_parent_accessor_name,
find_child_to_parent_serializer_field,
compute_default_ur... | {
"repo_name": "simpleenergy/django-rest-framework-nested-resource",
"path": "tests/test_utils.py",
"copies": "3",
"size": "10179",
"license": "bsd-3-clause",
"hash": -6890032925505138000,
"line_mean": 35.3535714286,
"line_max": 92,
"alpha_frac": 0.6666666667,
"autogenerated": false,
"ratio": 4.21... |
from django.test import TestCase
from django.db.models.query import CollectedObjects
from django.db.models.query_utils import CyclicDependency
from django.db.models.loading import cache
import django.db.models.sql
from models import A, B, C, D, E, F
test_last_cleared_field = ''
def clear_rel_obj_caches(models):
... | {
"repo_name": "sam-tsai/django-old",
"path": "tests/modeltests/delete/tests.py",
"copies": "1",
"size": "6369",
"license": "bsd-3-clause",
"hash": 607808148602767200,
"line_mean": 36.6863905325,
"line_max": 91,
"alpha_frac": 0.5657089025,
"autogenerated": false,
"ratio": 3.6064552661381652,
"co... |
from django.test import TestCase
from django.db.utils import DatabaseError
from django.db.models.fields import NOT_PROVIDED
from .testmodels import FieldsWithOptionsModel
from google.appengine.api.datastore import Get
from google.appengine.ext.db import Key
from google.appengine.api.datastore_types import Text, Categor... | {
"repo_name": "zaffra/Inquire",
"path": "GAE/djangoappengine/tests/field_options.py",
"copies": "6",
"size": "3800",
"license": "bsd-3-clause",
"hash": 8400265830030039000,
"line_mean": 46.5,
"line_max": 89,
"alpha_frac": 0.6594736842,
"autogenerated": false,
"ratio": 4.134929270946682,
"config... |
from django.test import TestCase
from django_dynamic_fixture import get
from readthedocs.organizations.models import Organization, Team, TeamInvite
class InviteTests(TestCase):
def setUp(self):
self.organization = get(Organization)
self.team = get(Team, organization=self.organization)
def t... | {
"repo_name": "rtfd/readthedocs.org",
"path": "readthedocs/organizations/tests/test_models.py",
"copies": "1",
"size": "1387",
"license": "mit",
"hash": 1204596148781110000,
"line_mean": 29.8222222222,
"line_max": 75,
"alpha_frac": 0.6222062004,
"autogenerated": false,
"ratio": 4.21580547112462,
... |
from django.test import TestCase
from django_dynamic_fixture import G
from oscar.apps.address import models, forms
from oscar.core.compat import get_user_model
User = get_user_model()
class TestUserAddressForm(TestCase):
def setUp(self):
self.user = G(User)
self.country = models.Country.objects... | {
"repo_name": "josesanch/django-oscar",
"path": "tests/integration/address/form_tests.py",
"copies": "19",
"size": "1331",
"license": "bsd-3-clause",
"hash": 8418143426814569000,
"line_mean": 33.1282051282,
"line_max": 78,
"alpha_frac": 0.6138241923,
"autogenerated": false,
"ratio": 3.65659340659... |
from django.test import TestCase
from django_dynamic_fixture import G
from oscar.apps.customer.models import Notification
from oscar.apps.customer.notifications import services
from oscar.core.compat import get_user_model
User = get_user_model()
class TestANewNotification(TestCase):
def setUp(self):
#... | {
"repo_name": "DrOctogon/unwash_ecom",
"path": "tests/unit/customer/notification_tests.py",
"copies": "20",
"size": "1507",
"license": "bsd-3-clause",
"hash": -5281775813432019000,
"line_mean": 27.9807692308,
"line_max": 74,
"alpha_frac": 0.6682149967,
"autogenerated": false,
"ratio": 3.986772486... |
from django.test import TestCase
from django_dynamic_fixture import G
from oscar.apps.offer import models
from oscar.apps.order.models import OrderDiscount
from oscar.core.compat import get_user_model
from oscar.test.factories import create_order
User = get_user_model()
class TestAPerUserConditionalOffer(TestCase)... | {
"repo_name": "jinnykoo/wuyisj",
"path": "tests/integration/offer/availability_tests.py",
"copies": "10",
"size": "1219",
"license": "bsd-3-clause",
"hash": -453842375774949440,
"line_mean": 35.9393939394,
"line_max": 74,
"alpha_frac": 0.7317473339,
"autogenerated": false,
"ratio": 3.482857142857... |
from django.test import TestCase
from django_dynamic_fixture import G
from oscar.core.compat import get_user_model
from oscar.apps.catalogue.reviews import forms, models
from oscar.test.factories import create_product
User = get_user_model()
class TestReviewForm(TestCase):
def setUp(self):
self.product... | {
"repo_name": "Idematica/django-oscar",
"path": "tests/integration/catalogue/reviews/form_tests.py",
"copies": "1",
"size": "1891",
"license": "bsd-3-clause",
"hash": 3876135659547950600,
"line_mean": 32.1754385965,
"line_max": 76,
"alpha_frac": 0.6166049709,
"autogenerated": false,
"ratio": 3.54... |
from django.test import TestCase
from django_filters import FilterSet
from directory.views import DirectoryView
from .models import TestModel, TestModelB
class DirectoryViewGetUnfilteredQueryset(TestCase):
def test_unfiltered_query_set_is_set___result_is_the_set_queryset(self):
class FilterClass(FilterSet... | {
"repo_name": "wildfish/django-directory",
"path": "tests/test_directory_view_get_unfiltered_queryset.py",
"copies": "1",
"size": "2017",
"license": "mit",
"hash": 6080989254812622000,
"line_mean": 31.5322580645,
"line_max": 95,
"alpha_frac": 0.618740704,
"autogenerated": false,
"ratio": 4.210855... |
from django.test import TestCase
from django.forms import ValidationError
from administracion.models import Escuela
from .models import Familia, Integrante, Alumno
from .forms import IntegranteModelForm, DeleteIntegranteForm
class TestIntegranteForm(TestCase):
""" Unit tests for the form to edit and create Integr... | {
"repo_name": "erikiado/jp2_online",
"path": "familias/tests.py",
"copies": "1",
"size": "8661",
"license": "mit",
"hash": 1856481148634304800,
"line_mean": 35.5443037975,
"line_max": 86,
"alpha_frac": 0.5774160028,
"autogenerated": false,
"ratio": 3.5700741962077496,
"config_test": true,
"ha... |
from django.test import TestCase
from django.forms.models import inlineformset_factory
from regressiontests.inline_formsets.models import Poet, Poem, School, Parent, Child
class DeletionTests(TestCase):
def test_deletion(self):
PoemFormSet = inlineformset_factory(Poet, Poem, can_delete=True)
poet =... | {
"repo_name": "iguzu/gae-django",
"path": "tests/regressiontests/inline_formsets/tests.py",
"copies": "3",
"size": "4035",
"license": "bsd-3-clause",
"hash": 5163091410770254000,
"line_mean": 38.9504950495,
"line_max": 89,
"alpha_frac": 0.5890954151,
"autogenerated": false,
"ratio": 3.57395925597... |
from django.test import TestCase
from django.http import Http404
from django_openid.consumer import Consumer
from django_openid import signed
from request_factory import RequestFactory
from openid_mocks import *
from openid.consumer import consumer as janrain_consumer
rf = RequestFactory()
class ConsumerTest(TestCa... | {
"repo_name": "indro/t2c",
"path": "apps/external_apps/django_openid/tests/consumer_tests.py",
"copies": "2",
"size": "6596",
"license": "mit",
"hash": 1430370831325535000,
"line_mean": 36.908045977,
"line_max": 78,
"alpha_frac": 0.6068829594,
"autogenerated": false,
"ratio": 4.14321608040201,
... |
from django.test import TestCase
from django.http import HttpRequest, HttpResponse, HttpResponseBadRequest
from django.template import Template, Context
from django.template.loader import render_to_string
from django.conf import settings
from honeypot.middleware import HoneypotViewMiddleware, HoneypotResponseMiddleware... | {
"repo_name": "pombredanne/django-honeypot",
"path": "honeypot/tests.py",
"copies": "3",
"size": "7501",
"license": "bsd-3-clause",
"hash": -4805700868762748000,
"line_mean": 44.4606060606,
"line_max": 110,
"alpha_frac": 0.673110252,
"autogenerated": false,
"ratio": 3.7941325240263026,
"config_... |
from django.test import TestCase
from django.http import HttpRequest
from django.contrib.auth.models import User, Permission
from core.models import Note
from tastefulpy.authorization import Authorization, ReadOnlyAuthorization, DjangoAuthorization
from tastefulpy.exceptions import Unauthorized
from tastefulpy import f... | {
"repo_name": "mjschultz/django-tastefulpy",
"path": "tests/core/tests/authorization.py",
"copies": "1",
"size": "10876",
"license": "bsd-3-clause",
"hash": 8601252513873991000,
"line_mean": 44.3166666667,
"line_max": 114,
"alpha_frac": 0.6946487679,
"autogenerated": false,
"ratio": 3.88289896465... |
from django.test import TestCase
from django.http import HttpRequest
from django.contrib.auth.models import User, Permission
from core.models import Note
from tastypie.authorization import Authorization, ReadOnlyAuthorization, DjangoAuthorization
from tastypie.exceptions import Unauthorized
from tastypie import fields
... | {
"repo_name": "doselect/django-tastypie",
"path": "tests/core/tests/authorization.py",
"copies": "14",
"size": "10916",
"license": "bsd-3-clause",
"hash": 2472167469298945500,
"line_mean": 44.4833333333,
"line_max": 114,
"alpha_frac": 0.6952180286,
"autogenerated": false,
"ratio": 3.8943988583660... |
from django.test import TestCase
from django.http import HttpRequest
from django.core.exceptions import PermissionDenied
from ...utils.handlers import registry
from ...decorators.functionbase import permission_required as f
from ...decorators.methodbase import permission_required as m
from ...decorators.classbase impor... | {
"repo_name": "lambdalisue/django-permission",
"path": "src/permission/tests/test_decorators/test_permission_required.py",
"copies": "1",
"size": "3567",
"license": "mit",
"hash": -358487335447163600,
"line_mean": 29.4871794872,
"line_max": 74,
"alpha_frac": 0.6582562377,
"autogenerated": false,
... |
from django.test import TestCase
from django.http import HttpRequest
from django.core.urlresolvers import resolve
from .views import home, getEvents
from .forms import CategoriesForm
from .services import getCategoryID, results
import os
class SearchPageTest(TestCase):
def test_home_page_url(self):
page... | {
"repo_name": "vipulkanade/EventbriteDjango",
"path": "src_eventbrite_django/topthree/tests.py",
"copies": "1",
"size": "3070",
"license": "mit",
"hash": 5589792318381649000,
"line_mean": 27.691588785,
"line_max": 112,
"alpha_frac": 0.619218241,
"autogenerated": false,
"ratio": 3.9561855670103094... |
from django.test import TestCase
from django.http import HttpRequest
from django.http import HttpResponseBadRequest, HttpResponse
from referral_module import middleware, models, constants
from .factories import UserReferrerFactory, CampaignFactory
def request_response_helper(cp, uk, response_class=HttpResponse):
... | {
"repo_name": "moneypark/whydjango",
"path": "referral_module/tests/test_middleware.py",
"copies": "1",
"size": "3214",
"license": "mit",
"hash": -1958407519441766400,
"line_mean": 35.9425287356,
"line_max": 105,
"alpha_frac": 0.6767268202,
"autogenerated": false,
"ratio": 3.8491017964071856,
"... |
from django.test import TestCase
from django.http import HttpRequest
from eveigb import IGBHeaderParser
class IGBHeaderParserTestCase(TestCase):
#-------------------------------------------------------------------------
# Test set up
#-----------------------------------------------------------------... | {
"repo_name": "jenslauterbach/django-eve-igb",
"path": "eveigb/tests/tests.py",
"copies": "1",
"size": "13826",
"license": "mit",
"hash": -808918684659357000,
"line_mean": 37.4083333333,
"line_max": 85,
"alpha_frac": 0.5863590337,
"autogenerated": false,
"ratio": 4.143242433323344,
"config_test... |
from django.test import TestCase
from django.http import HttpRequest
import datetime as D
from wafer.schedule.admin import SlotAdmin
from wafer.schedule.models import Day, Slot
class DummyForm(object):
def __init__(self):
self.cleaned_data = {}
def make_dummy_form(additional):
"""Fake a form objec... | {
"repo_name": "CarlFK/wafer",
"path": "wafer/schedule/tests/test_admin.py",
"copies": "1",
"size": "5411",
"license": "isc",
"hash": -5754752062992912000,
"line_mean": 42.6370967742,
"line_max": 76,
"alpha_frac": 0.625762336,
"autogenerated": false,
"ratio": 3.3988693467336684,
"config_test": t... |
from django.test import TestCase
from django.http import HttpRequest, QueryDict
from contacts_and_people.models import Entity, Person
from arkestra_utilities.text import concatenate
from arkestra_utilities.generic_lister import (
ArkestraGenericLister, ArkestraGenericList, ArkestraGenericFilterSet,
ArkestraGe... | {
"repo_name": "evildmp/Arkestra",
"path": "tests/arkestra_utilities/test_utilities.py",
"copies": "1",
"size": "9710",
"license": "bsd-2-clause",
"hash": -5048182111824205000,
"line_mean": 27.226744186,
"line_max": 77,
"alpha_frac": 0.6004119464,
"autogenerated": false,
"ratio": 3.896468699839486... |
from django.test import TestCase
from django.http.request import HttpRequest, QueryDict
from django.conf import settings
import pickle
import json
import os
from api.login.views import LoginRequest
from api.login.tree import tree_to_table
from core.models import Course
from core.rule.tree import TreeLoader
class Dumm... | {
"repo_name": "skystar-p/graduate-adventure",
"path": "backend/api/login/tests.py",
"copies": "5",
"size": "2944",
"license": "mit",
"hash": -3690024953652338700,
"line_mean": 30.8,
"line_max": 94,
"alpha_frac": 0.5957372467,
"autogenerated": false,
"ratio": 3.2934407364787113,
"config_test": t... |
from django.test import TestCase
from django import forms as django_forms
import forms
class FieldsetRenderTestCase(TestCase):
def _test_form(self):
class TestForm(django_forms.Form, forms.FieldsetMixin):
test_field1 = django_forms.CharField()
test_field2 = django_forms.CharField()... | {
"repo_name": "OddBloke/django-formfieldset",
"path": "formfieldset/tests.py",
"copies": "1",
"size": "2303",
"license": "bsd-3-clause",
"hash": -2548967692608624000,
"line_mean": 40.8727272727,
"line_max": 191,
"alpha_frac": 0.5462440295,
"autogenerated": false,
"ratio": 3.781609195402299,
"co... |
from django.test import TestCase
from django import forms
from django.contrib.auth.models import User
from mediaviewer.forms import FormlessPasswordReset
import mock
class TestFormlessPasswordReset(TestCase):
def setUp(self):
self.email = 'test@email.com'
self.user = mock.create_autospec(User)
... | {
"repo_name": "kyokley/MediaViewer",
"path": "mediaviewer/tests/test_forms.py",
"copies": "1",
"size": "1158",
"license": "mit",
"hash": -2412854022161398000,
"line_mean": 35.1875,
"line_max": 64,
"alpha_frac": 0.6977547496,
"autogenerated": false,
"ratio": 3.61875,
"config_test": true,
"has_... |
from django.test import TestCase
from django import forms
from django.contrib.auth.models import User
from richtemplates.fields import ModelByNameField
from richtemplates.forms import LimitingModelForm
class TestForm(forms.Form):
user = ModelByNameField(queryset=User.objects.all(), attr='username')
class TestFor... | {
"repo_name": "lukaszb/django-richtemplates",
"path": "richtemplates/tests/test_fields.py",
"copies": "1",
"size": "1219",
"license": "bsd-3-clause",
"hash": 3214057242301345000,
"line_mean": 33.8285714286,
"line_max": 77,
"alpha_frac": 0.6931911403,
"autogenerated": false,
"ratio": 3.79750778816... |
from django.test import TestCase
from django import forms
from django.contrib.contenttypes.models import ContentType
from cms.models.placeholdermodel import Placeholder
from cms.api import add_plugin
from filer.models.imagemodels import Image
from links.models import Link, GenericLinkListPluginItem, CarouselPluginIt... | {
"repo_name": "evildmp/Arkestra",
"path": "tests/links/test_links.py",
"copies": "1",
"size": "8232",
"license": "bsd-2-clause",
"hash": 3423631793434591000,
"line_mean": 33.0165289256,
"line_max": 160,
"alpha_frac": 0.5976676385,
"autogenerated": false,
"ratio": 4.350951374207188,
"config_test... |
from django.test import TestCase
from django import forms
from django.db import models
from django.core.files.storage import default_storage
from django.core.files.base import ContentFile
from directupload import widgets
class TestModel(models.Model):
char_field = models.CharField(max_length=20)
file_field = ... | {
"repo_name": "cuker/django-directupload",
"path": "directupload/tests/widgets.py",
"copies": "1",
"size": "1357",
"license": "bsd-3-clause",
"hash": 5055989038215833000,
"line_mean": 33.7948717949,
"line_max": 72,
"alpha_frac": 0.6838614591,
"autogenerated": false,
"ratio": 3.8441926345609065,
... |
from django.test import TestCase
from django import forms
from djangorestframework.compat import RequestFactory
from djangorestframework.views import View
from djangorestframework.resources import FormResource
import StringIO
class UploadFilesTests(TestCase):
"""Check uploading of files"""
def setUp(self):
... | {
"repo_name": "seanfisk/buzzword-bingo-server",
"path": "djangorestframework/tests/files.py",
"copies": "1",
"size": "1039",
"license": "bsd-3-clause",
"hash": -8323013678212478000,
"line_mean": 31.46875,
"line_max": 98,
"alpha_frac": 0.6256015399,
"autogenerated": false,
"ratio": 4.3112033195020... |
from django.test import TestCase
from django import forms
from avocado.columns.models import Column
from avocado.fields.models import Field
__all__ = ('FieldTestCase',)
class FieldTestCase(TestCase):
fixtures = ['test_data.yaml']
def test_base(self):
fc = Field.objects.get(pk=1)
self.assert... | {
"repo_name": "pombredanne/django-avocado",
"path": "avocado/fields/tests/models.py",
"copies": "1",
"size": "2044",
"license": "bsd-3-clause",
"hash": -8371555616326313000,
"line_mean": 29.5074626866,
"line_max": 82,
"alpha_frac": 0.595890411,
"autogenerated": false,
"ratio": 3.72992700729927,
... |
from django.test import TestCase
from django import forms
from umessages.fields import CommaSeparatedUserField
class CommaSeparatedTestForm(forms.Form):
users = CommaSeparatedUserField()
def __init__(self, *args, **kwargs):
super(CommaSeparatedTestForm, self).__init__(*args, **kwargs)
self.fi... | {
"repo_name": "euanlau/django-umessages",
"path": "umessages/tests/fields.py",
"copies": "1",
"size": "2151",
"license": "bsd-3-clause",
"hash": 4205122959535170600,
"line_mean": 38.8333333333,
"line_max": 88,
"alpha_frac": 0.5355648536,
"autogenerated": false,
"ratio": 4.184824902723736,
"conf... |
from django.test import TestCase
from django import template
from django.contrib.auth.models import User, Group, Permission
from django.core.urlresolvers import reverse
from django.core.files.uploadedfile import SimpleUploadedFile
from wagtail.tests.utils import unittest, WagtailTestUtils
from wagtail.wagtailimages.mo... | {
"repo_name": "helenwarren/pied-wagtail",
"path": "wagtail/wagtailimages/tests.py",
"copies": "1",
"size": "13233",
"license": "bsd-3-clause",
"hash": -7653568657386305000,
"line_mean": 32.2487437186,
"line_max": 138,
"alpha_frac": 0.6457341495,
"autogenerated": false,
"ratio": 3.877234104893056,... |
from django.test import TestCase
from django import template
import re
from categories.models import Category
class CategoryTagsTest(TestCase):
fixtures = ['musicgenres.json']
def render_template(self, template_string, context={}):
"""
Return the rendered string or raise an exception.
... | {
"repo_name": "miceno/django-categories",
"path": "categories/tests/test_templatetags.py",
"copies": "3",
"size": "3376",
"license": "apache-2.0",
"hash": 1077418683303948700,
"line_mean": 44.0133333333,
"line_max": 252,
"alpha_frac": 0.5912322275,
"autogenerated": false,
"ratio": 3.7058177826564... |
from django.test import TestCase
from django import template
from categories.models import Category
class CategoryTagsTest(TestCase):
fixtures = ['musicgenres.json']
def render_template(self, template_string, context={}):
"""
Return the rendered string or raise an exception.
"""
... | {
"repo_name": "Govexec/django-categories",
"path": "categories/tests/templatetags.py",
"copies": "3",
"size": "3227",
"license": "apache-2.0",
"hash": -1938245447302439700,
"line_mean": 47.1641791045,
"line_max": 253,
"alpha_frac": 0.6086148125,
"autogenerated": false,
"ratio": 3.6837899543378994... |
from django.test import TestCase
from django import template
class GetCategoryTest(TestCase):
fixtures = ['musicgenres.json']
def render_template(self, template_string, context={}):
"""
Return the rendered string or raise an exception.
"""
tpl = template.Template(temp... | {
"repo_name": "indexofire/gravoicy",
"path": "gravoicy/apps/categories/tests/templatetags.py",
"copies": "1",
"size": "2438",
"license": "bsd-3-clause",
"hash": 1155806860966231600,
"line_mean": 49.8125,
"line_max": 532,
"alpha_frac": 0.6435602953,
"autogenerated": false,
"ratio": 3.4778887303851... |
from django.test import TestCase
from django_jsx.client import template_client
from django.conf import settings
from os.path import join
class MockSock():
def send(self, message):
pass
def recv(self, buffer_size):
return b''
def mock_connect():
return MockSock()
class TestTemplateClie... | {
"repo_name": "jonashagstedt/django-jsx",
"path": "tests/test_template_client.py",
"copies": "2",
"size": "2400",
"license": "bsd-3-clause",
"hash": -5709095938919754000,
"line_mean": 30.1688311688,
"line_max": 74,
"alpha_frac": 0.6170833333,
"autogenerated": false,
"ratio": 4.363636363636363,
... |
from django.test import TestCase
from django_mailbox.models import Message
from batch_apps.models import App, Day, Execution
from batch_apps.generator import get_current_date_in_gmt8
import datetime
class MessageModelTest(TestCase):
fixtures = ['test_messages.json']
def test_retrieve_emails_subjects_from_db... | {
"repo_name": "azam-a/batcher",
"path": "batch_apps/tests/test_models.py",
"copies": "1",
"size": "7577",
"license": "mit",
"hash": 3786080928711192600,
"line_mean": 50.5442176871,
"line_max": 118,
"alpha_frac": 0.6802164445,
"autogenerated": false,
"ratio": 3.3600886917960087,
"config_test": t... |
from django.test import TestCase
from django_postgres import Bits, B
import models
class SimpleTest(TestCase):
def test_can_create_bitstrings(self):
bloom = models.BloomFilter.objects.create(name='foo')
# Default bit string is all zeros.
assert bloom.bitmap.bin == ('0' * 8)
def test... | {
"repo_name": "isotoma/django-postgres",
"path": "tests/test_project/bitstringtest/tests.py",
"copies": "2",
"size": "3431",
"license": "unlicense",
"hash": -7734791021998174000,
"line_mean": 32.9702970297,
"line_max": 82,
"alpha_frac": 0.5674730399,
"autogenerated": false,
"ratio": 3.79535398230... |
from django.test import TestCase
from django_prometheus.testutils import PrometheusTestCaseMixin
from testapp.models import Dog, Lawn
def M(metric_name):
"""Make a full metric name from a short metric name.
This is just intended to help keep the lines shorter in test
cases.
"""
return "django_mod... | {
"repo_name": "korfuri/django-prometheus",
"path": "django_prometheus/tests/end2end/testapp/test_models.py",
"copies": "1",
"size": "1716",
"license": "apache-2.0",
"hash": 8843199787760650000,
"line_mean": 33.32,
"line_max": 76,
"alpha_frac": 0.634032634,
"autogenerated": false,
"ratio": 3.50204... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.