text stringlengths 0 1.05M | meta dict |
|---|---|
from django.test import TestCase
from django.contrib.auth.models import Group
from hs_core.testing import MockIRODSTestCaseMixin
from hs_core import hydroshare
from hs_access_control.models import PrivilegeCodes
class TestExplicitGroupAccess(MockIRODSTestCaseMixin, TestCase):
def setUp(self):
super(Test... | {
"repo_name": "FescueFungiShare/hydroshare",
"path": "hs_access_control/tests/test_explicit_group_access.py",
"copies": "1",
"size": "3592",
"license": "bsd-3-clause",
"hash": -1489781379094753300,
"line_mean": 40.2873563218,
"line_max": 82,
"alpha_frac": 0.6124721604,
"autogenerated": false,
"ra... |
from django.test import TestCase
from django.contrib.auth.models import User, Group
from django.db.models import Q
class AppTestCase(TestCase):
def setUp(self):
self.surgeon = Group.objects.create(name='Surgeon')
self.flagged = Group.objects.create(name='Flagged')
def test_m2m_count(self):
... | {
"repo_name": "bbenko/doiainn",
"path": "code/doiainn/app/tests.py",
"copies": "1",
"size": "1362",
"license": "mit",
"hash": 1759255930737674000,
"line_mean": 37.9142857143,
"line_max": 79,
"alpha_frac": 0.6042584435,
"autogenerated": false,
"ratio": 3.7938718662952646,
"config_test": false,
... |
from django.test import TestCase
from django.contrib.auth.models import User, Group, Permission
from django.contrib.contenttypes.models import ContentType
from wagtail.images.tests.utils import get_test_image_file, Image
from molo.core.models import (
Main, SiteLanguageRelation, Languages,
ArticlePage, Reactio... | {
"repo_name": "praekelt/molo",
"path": "molo/core/tests/test_admin_view.py",
"copies": "1",
"size": "7994",
"license": "bsd-2-clause",
"hash": 5045179632076996000,
"line_mean": 40.206185567,
"line_max": 79,
"alpha_frac": 0.6387290468,
"autogenerated": false,
"ratio": 4.049645390070922,
"config_... |
from django.test import TestCase
from django.contrib.auth.models import User, Group, Permission
from views import *
def add_permissions(group, codenames):
""" Add a permission to the group """
if isinstance(codenames, basestring):
codenames = [codenames]
for codename in codenames:
perm = ge... | {
"repo_name": "tedwen/tea-scrum",
"path": "TeaScrum/product/tests.py",
"copies": "1",
"size": "3808",
"license": "apache-2.0",
"hash": -4448613978827185700,
"line_mean": 40.8571428571,
"line_max": 118,
"alpha_frac": 0.5903361345,
"autogenerated": false,
"ratio": 3.5129151291512914,
"config_test... |
from django.test import TestCase
from django.contrib.auth.models import User
from approver.models import Person,Project
from approver.workflows import project_crud
class ProjectWorkFlowTestCase(TestCase):
def setUp(self):
"""
Create test data for user,person,project for testing project_crud workflow.
"""
self... | {
"repo_name": "ctsit/qipr_approver",
"path": "qipr_approver/approver/tests/tests_workflows/test_project.py",
"copies": "3",
"size": "1658",
"license": "apache-2.0",
"hash": -2204295279514107400,
"line_mean": 39.4390243902,
"line_max": 105,
"alpha_frac": 0.7659831122,
"autogenerated": false,
"rati... |
from django.test import TestCase
from django.contrib.auth.models import User
from corehq.apps.users.models import CouchUser, CommCareUser
from couchforms.models import XFormInstance
class UpdateTestCase(TestCase):
def setUp(self):
all_users = CouchUser.all()
for user in all_users:
... | {
"repo_name": "SEL-Columbia/commcare-hq",
"path": "corehq/apps/users/tests/update.py",
"copies": "1",
"size": "2402",
"license": "bsd-3-clause",
"hash": 570968713984284800,
"line_mean": 46.0980392157,
"line_max": 106,
"alpha_frac": 0.6761032473,
"autogenerated": false,
"ratio": 3.5065693430656935... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from airline_manager.forms import AirlineForm, ConfigurationForm
from airline_manager.models import Airline, Alliance, Airport, PlaneType, Line, Plane, Hub
from django.core.urlresolvers im... | {
"repo_name": "Dunstark/open_airline_manager",
"path": "airline_manager/tests.py",
"copies": "1",
"size": "7933",
"license": "mit",
"hash": -3910985698977931000,
"line_mean": 45.6647058824,
"line_max": 141,
"alpha_frac": 0.6774234212,
"autogenerated": false,
"ratio": 3.513286093888397,
"config_... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.auth.hashers import make_password
from django.core.exceptions import ObjectDoesNotExist
from op_tasks.models import Dataset, \
Product, OpTask, UserProfile, TaskListItem, Experiment, Achievement, UserAchievement
import ... | {
"repo_name": "draperlaboratory/stout",
"path": "op_tasks/tests.py",
"copies": "2",
"size": "8903",
"license": "apache-2.0",
"hash": 7282438355261339000,
"line_mean": 29.0777027027,
"line_max": 99,
"alpha_frac": 0.7334606312,
"autogenerated": false,
"ratio": 3.0774282751469064,
"config_test": t... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login
from mooshell.models import *
TEST_LIB_GROUP_NAME = 'TestLib'
TEST_LIB_WRAP_NAME = 'TestWrap'
TEST_LIB_WRAP_NAME_D = "%s_d" % TEST_LIB_WRAP_NAME
TEST_LIB_WRAP_NAME_L = "%s_l" % TEST_LIB_WRA... | {
"repo_name": "marcofucci/mooshell",
"path": "testcases/base.py",
"copies": "3",
"size": "2849",
"license": "mit",
"hash": -5360539173730317000,
"line_mean": 25.8773584906,
"line_max": 89,
"alpha_frac": 0.7051597052,
"autogenerated": false,
"ratio": 2.6979166666666665,
"config_test": true,
"h... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.auth.models import AnonymousUser
from django.conf import settings
from django.urls import reverse
from lfs.core.models import Country
from lfs.customer.utils import get_or_create_customer
from lfs.customer_tax.models impor... | {
"repo_name": "diefenbach/django-lfs",
"path": "lfs/shipping/tests.py",
"copies": "1",
"size": "15620",
"license": "bsd-3-clause",
"hash": 4480024713032553000,
"line_mean": 38.4444444444,
"line_max": 123,
"alpha_frac": 0.6491037132,
"autogenerated": false,
"ratio": 3.674429545989179,
"config_te... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.auth.models import Group
from hs_core import hydroshare
from hs_core.models import BaseResource
from hs_core.testing import MockIRODSTestCaseMixin
from hs_labels.models import UserLabels, ResourceLabels, \
UserResource... | {
"repo_name": "hydroshare/hydroshare",
"path": "hs_labels/tests/test_resource_labelling.py",
"copies": "1",
"size": "16096",
"license": "bsd-3-clause",
"hash": 3243268302973435000,
"line_mean": 49.7760252366,
"line_max": 117,
"alpha_frac": 0.6617171968,
"autogenerated": false,
"ratio": 3.45037513... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.auth.models import Permission as DjangoPermission
import authority
from authority import permissions
from authority.models import Permission
from authority.exceptions import NotAModel, UnsavedModelInstance
class UserPermi... | {
"repo_name": "azizmb/django-authority",
"path": "authority/tests.py",
"copies": "1",
"size": "5242",
"license": "bsd-3-clause",
"hash": 9095531301320808000,
"line_mean": 31.9748427673,
"line_max": 90,
"alpha_frac": 0.6571919115,
"autogenerated": false,
"ratio": 3.897397769516729,
"config_test"... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.gis.geos import Point, Polygon
from geotagging.models import Geotag
from geotagging import register, AlreadyRegistered
class ModelTest(TestCase):
def setUp(self):
try:
register(User)
e... | {
"repo_name": "lincolnloop/django-geotagging",
"path": "geotagging/tests/model_tests.py",
"copies": "1",
"size": "1825",
"license": "bsd-3-clause",
"hash": -662529686541038100,
"line_mean": 34.8039215686,
"line_max": 73,
"alpha_frac": 0.6191780822,
"autogenerated": false,
"ratio": 3.3985102420856... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.sessions.backends.db import SessionStore
from filecreator.creator import Creator
from faker import Faker
import json
import os
# Create your tests here.
class TestCode(TestCase):
fake = Faker()
def setUp(self):... | {
"repo_name": "OGKevin/ComBunqWebApp",
"path": "filecreator/tests.py",
"copies": "1",
"size": "1598",
"license": "mit",
"hash": -7661930360822153000,
"line_mean": 25.6333333333,
"line_max": 76,
"alpha_frac": 0.6176470588,
"autogenerated": false,
"ratio": 3.699074074074074,
"config_test": true,
... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.core.cache import cache
from boardinghouse.models import Schema
from boardinghouse.schema import get_active_schemata
class TestUserSchemataCache(TestCase):
def test_adding_schema_to_user_clears_cache(self):
User.obje... | {
"repo_name": "schinckel/django-boardinghouse",
"path": "tests/tests/test_user_schemata.py",
"copies": "1",
"size": "3158",
"license": "bsd-3-clause",
"hash": -2308949840771901000,
"line_mean": 36.5952380952,
"line_max": 87,
"alpha_frac": 0.6529449018,
"autogenerated": false,
"ratio": 3.317226890... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import IntegrityError
from dashboard.models import BucketList, BucketListItem
class BucketListTestCase(TestCase):
"""
Testcase for the BucketList model.
"""
f... | {
"repo_name": "andela-uawili/django-bucketlist-application",
"path": "bucketlist/tests/dashboard/test_models.py",
"copies": "1",
"size": "2533",
"license": "mit",
"hash": -8808633027080391000,
"line_mean": 31.0632911392,
"line_max": 76,
"alpha_frac": 0.6119226214,
"autogenerated": false,
"ratio":... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.core.files import File
from . import TearDownMixin
from ..serializers import ShelfSerializer, AudioSerializer
from ..models import ImageShelf, Image, AudioShelf, Audio
class BaseFileSerializerTest(TestCase):
def setUp(self):... | {
"repo_name": "pulilab/django-medialibrary",
"path": "medialibrary/tests/serializers.py",
"copies": "1",
"size": "2367",
"license": "bsd-3-clause",
"hash": 830850076559834400,
"line_mean": 37.8032786885,
"line_max": 91,
"alpha_frac": 0.6404731728,
"autogenerated": false,
"ratio": 3.66976744186046... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from imager_images.models import Photo, Album
import factory
from faker import Faker
fake = Faker()
class UserFactory(factory.django.DjangoModelFactory):
class Meta:
model = User
... | {
"repo_name": "gatita/django-imager",
"path": "imagersite/imager_images/tests.py",
"copies": "1",
"size": "17292",
"license": "mit",
"hash": 8343332111372964000,
"line_mean": 32.0630975143,
"line_max": 81,
"alpha_frac": 0.583795975,
"autogenerated": false,
"ratio": 3.9916897506925206,
"config_t... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
import factory
from .models import ImagerProfile
class UserFactory(factory.Factory):
class Meta:
model = User
username = factory.Sequence(lambda n: 'user{}'.format(n))
email =... | {
"repo_name": "gatita/django-imager",
"path": "imagersite/imager_profile/tests.py",
"copies": "1",
"size": "4174",
"license": "mit",
"hash": 37839018475142344,
"line_mean": 28.8142857143,
"line_max": 73,
"alpha_frac": 0.6094873023,
"autogenerated": false,
"ratio": 3.8399264029438824,
"config_te... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
class MessageTestCase(TestCase):
fixtures = ['users.json']
def setUp(self):
self.user1 = User.objects.get(username='nathanb')
self.user2 = User.objects.get(username='l... | {
"repo_name": "hittu123/ruhive",
"path": "src/basic/messages/tests.py",
"copies": "1",
"size": "2003",
"license": "mit",
"hash": -671736691272300200,
"line_mean": 41.6170212766,
"line_max": 103,
"alpha_frac": 0.6335496755,
"autogenerated": false,
"ratio": 4.0628803245436105,
"config_test": true... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.shortcuts import reverse
from django.utils import timezone
import datetime
import decimal
from .models import Budget, BudgetCategory, Wallet, Transaction
class BudgetViewsTests(TestCase):
def setUp(self):
# Create a... | {
"repo_name": "zcking/Pynny",
"path": "mysite/pynny/test_budget_views.py",
"copies": "1",
"size": "7992",
"license": "mit",
"hash": -3462724035172987400,
"line_mean": 43.1546961326,
"line_max": 165,
"alpha_frac": 0.5848348348,
"autogenerated": false,
"ratio": 3.757404795486601,
"config_test": t... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.test import Client
from django.core.urlresolvers import reverse
from django.conf import settings
from ..models.device import Device
class DeviceViewTestCase(TestCase):
def setUp(self):
self.test1 = User.objects.creat... | {
"repo_name": "Atilla106/members.atilla.org",
"path": "network/tests/tests_device_view.py",
"copies": "1",
"size": "7230",
"license": "mit",
"hash": -8356768813257477000,
"line_mean": 30.4347826087,
"line_max": 76,
"alpha_frac": 0.5889349931,
"autogenerated": false,
"ratio": 3.992269464384318,
... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.test import Client
import factory
class UserFactory(factory.django.DjangoModelFactory):
class Meta:
model = User
django_get_or_create = ('username',)
username = 'bob'
password = factory.PostGeneratio... | {
"repo_name": "nbeck90/game-chat",
"path": "gamechat/gamechat/tests.py",
"copies": "1",
"size": "2822",
"license": "mit",
"hash": -8250453751587999000,
"line_mean": 31.4367816092,
"line_max": 75,
"alpha_frac": 0.5836286322,
"autogenerated": false,
"ratio": 4.143906020558003,
"config_test": true... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.test.utils import override_settings
from organizations.models import Organization
from organizations.utils import create_organization, model_field_attr
@override_settings(USE_TZ=True)
class OrgManagerTests(TestCase):
fixtur... | {
"repo_name": "aptivate/django-organizations",
"path": "organizations/tests/test_utils.py",
"copies": "4",
"size": "1039",
"license": "bsd-2-clause",
"hash": -6891493240529104000,
"line_mean": 31.46875,
"line_max": 77,
"alpha_frac": 0.7102983638,
"autogenerated": false,
"ratio": 3.906015037593985... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.urls import reverse
from django.core import mail
from factory.django import DjangoModelFactory, ImageField
from image.models import Photo
class PhotoFactory(DjangoModelFactory):
class Meta(object):
model = Photo
p... | {
"repo_name": "welliam/imagersite",
"path": "imagersite/tests.py",
"copies": "1",
"size": "6324",
"license": "mit",
"hash": 1261442977743148300,
"line_mean": 32.4603174603,
"line_max": 79,
"alpha_frac": 0.6185958254,
"autogenerated": false,
"ratio": 4.204787234042553,
"config_test": true,
"ha... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.utils import simplejson
from django.conf import settings
from django.core.urlresolvers import reverse
from piston import oauth
from piston.models import Consumer, Token
from piston.forms import OAuthAuthenticationForm
import urlli... | {
"repo_name": "spreeker/democracygame",
"path": "democracy/api/tests.py",
"copies": "1",
"size": "23854",
"license": "bsd-3-clause",
"hash": -1268406925801081300,
"line_mean": 35.0332326284,
"line_max": 121,
"alpha_frac": 0.566320114,
"autogenerated": false,
"ratio": 3.5027900146842876,
"config... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.utils import timezone
from api.models import Author, Post, Comment, Friending
import uuid
import requests
from urllib import urlencode
from rest_framework import HTTP_HEADER_ENCODING
import base64
from rest_framework.test import AP... | {
"repo_name": "CMPUT404Group/CMPUT404-project-socialdistribution",
"path": "api/tests.py",
"copies": "1",
"size": "31907",
"license": "apache-2.0",
"hash": -1960768772421867800,
"line_mean": 47.5662100457,
"line_max": 162,
"alpha_frac": 0.6605447081,
"autogenerated": false,
"ratio": 3.80706359622... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.utils import timezone
from django.dispatch import receiver
from projects.models import (
Dependency, ProjectDependency, ProjectBuild, generate_projectbuild_id,
ProjectBuildDependency, projectbuild_finished)
from .factories... | {
"repo_name": "timrchavez/capomastro",
"path": "projects/tests/test_models.py",
"copies": "1",
"size": "9910",
"license": "mit",
"hash": -7467255946001947000,
"line_mean": 37.4108527132,
"line_max": 79,
"alpha_frac": 0.6688193744,
"autogenerated": false,
"ratio": 4.502498864152658,
"config_test... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.utils import timezone
from django.template.defaultfilters import slugify
from decimal import Decimal
from post.models import Question, Channel
from root.algorithms import parser
from root.algorithms.popularity import _popularity
... | {
"repo_name": "jeremyphilemon/uniqna",
"path": "post/tests/test_models.py",
"copies": "2",
"size": "4969",
"license": "bsd-3-clause",
"hash": -1235402940064608300,
"line_mean": 30.251572327,
"line_max": 83,
"alpha_frac": 0.7188569129,
"autogenerated": false,
"ratio": 2.9298349056603774,
"config... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.utils import timezone
from datetime import datetime
from decimal import Decimal
from mptt.models import TreeForeignKey
from post.models import Question
from threads.models import Answer
from root.algorithms import parser
from roo... | {
"repo_name": "uniqna/uniqna",
"path": "threads/tests/test_models.py",
"copies": "2",
"size": "4821",
"license": "bsd-3-clause",
"hash": -8430281497202291000,
"line_mean": 27.8682634731,
"line_max": 82,
"alpha_frac": 0.7048330222,
"autogenerated": false,
"ratio": 2.856042654028436,
"config_test... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.utils import timezone
import datetime
from .models import Budget, BudgetCategory, Wallet, Transaction, Savings
class ModelStrTests(TestCase):
def setUp(self):
# Create a user and give them some data to test with
... | {
"repo_name": "zcking/Pynny",
"path": "mysite/pynny/test_models.py",
"copies": "1",
"size": "2250",
"license": "mit",
"hash": -807653454732238700,
"line_mean": 39.1785714286,
"line_max": 190,
"alpha_frac": 0.6471111111,
"autogenerated": false,
"ratio": 3.577106518282989,
"config_test": true,
... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.utils.timezone import now
from mock import Mock, patch
from achievements.models import Achievement
from commits.models import CommitAuthor
from projects.factories import ProjectFactory
from projects.models import Project
from .... | {
"repo_name": "dmrz/gitality",
"path": "gitality/progresses/tests.py",
"copies": "1",
"size": "5643",
"license": "mit",
"hash": 7464511953704368000,
"line_mean": 37.9172413793,
"line_max": 77,
"alpha_frac": 0.6533758639,
"autogenerated": false,
"ratio": 3.8756868131868134,
"config_test": true,
... |
from django.test import TestCase
from django.contrib.auth.models import User
from dwitter.models import Dweet, Comment, Hashtag
from django.utils import timezone
from datetime import timedelta
class HashtagTestCase(TestCase):
def setUp(self):
user1 = User.objects.create(username="user1", password="")
... | {
"repo_name": "lionleaf/dwitter",
"path": "dwitter/tests/models/test_hashtags.py",
"copies": "1",
"size": "3901",
"license": "apache-2.0",
"hash": 1859155805510221800,
"line_mean": 39.6354166667,
"line_max": 80,
"alpha_frac": 0.5124327096,
"autogenerated": false,
"ratio": 4.063541666666667,
"co... |
from django.test import TestCase
from django.contrib.auth.models import User
from feds.settings import FEDS_BASIC_SETTING_GROUP, FEDS_INTEGER_SETTING, \
FEDS_TEXT_NOTIONAL_FIELD
from fieldsettings.models import FieldSettingDb
from fieldspecs.models import FieldSpecDb, NotionalTableMembershipDb, \
AvailableField... | {
"repo_name": "kieranmathieson/feds",
"path": "projects/test_read_write_project.py",
"copies": "1",
"size": "4846",
"license": "apache-2.0",
"hash": 954726005800483300,
"line_mean": 35.7121212121,
"line_max": 75,
"alpha_frac": 0.5891456872,
"autogenerated": false,
"ratio": 3.818754925137904,
"c... |
from django.test import TestCase
from django.contrib.auth.models import User
from generic_follow.models import Follow
from .models import Band, Photographer
class GenericFollowUserMixinTests(TestCase):
def setUp(self):
self.user = User.objects.create_user(
username='john',
password... | {
"repo_name": "pombredanne/django-generic-follow",
"path": "tests/tests.py",
"copies": "2",
"size": "5647",
"license": "mit",
"hash": -4319111353514283000,
"line_mean": 34.29375,
"line_max": 97,
"alpha_frac": 0.6461838144,
"autogenerated": false,
"ratio": 3.60140306122449,
"config_test": true,
... |
from django.test import TestCase
from django.contrib.auth.models import User
from mock import Mock, patch
from core.channel import (Channel, NotSupportedTrigger, NotSupportedAction,
ConditionNotMet, ChannelStateForUser)
from django.test.client import Client
from django.core.urlresolvers impor... | {
"repo_name": "daisychainme/daisychain",
"path": "daisychain/channel_gmail/tests/test_channel.py",
"copies": "1",
"size": "4119",
"license": "mit",
"hash": -9011845622914728000,
"line_mean": 56.2083333333,
"line_max": 120,
"alpha_frac": 0.6331633892,
"autogenerated": false,
"ratio": 2.82704186684... |
from django.test import TestCase
from django.contrib.auth.models import User
from models import ChatRoom
import factory
class UserFactory(factory.django.DjangoModelFactory):
class Meta:
model = User
django_get_or_create = ('username',)
username = 'bob'
# password = factory.PostGeneration... | {
"repo_name": "nbeck90/game-chat",
"path": "gamechat/chat/tests.py",
"copies": "1",
"size": "1770",
"license": "mit",
"hash": -1504537707250240300,
"line_mean": 31.1818181818,
"line_max": 79,
"alpha_frac": 0.697740113,
"autogenerated": false,
"ratio": 3.672199170124481,
"config_test": true,
"... |
from django.test import TestCase
from django.contrib.auth.models import User
from models import Item, Bill, BillItem, BillItemExtra, Category
from dbmanager import commit_bill, undo_bill
class BillTestCase(TestCase):
def setUp(self):
self.output = {'errors': [],
'bill_id': None,
... | {
"repo_name": "radome/OpenPif",
"path": "OpenPif/OpenGenfri/tests.py",
"copies": "2",
"size": "8061",
"license": "mit",
"hash": 2261058752717537800,
"line_mean": 45.3275862069,
"line_max": 106,
"alpha_frac": 0.4715295869,
"autogenerated": false,
"ratio": 4.0385771543086175,
"config_test": true,... |
from django.test import TestCase
from django.contrib.auth.models import User
from .models import MarvelProfile
from m_comics.models import Comic, ReadingList
from rest_framework import status
from rest_framework.authtoken.models import Token
from rest_framework.test import APIRequestFactory, APIClient, APITestCase
im... | {
"repo_name": "marvel-explorer/marvel-explorer",
"path": "m_explorer/m_profile/tests.py",
"copies": "1",
"size": "9083",
"license": "mit",
"hash": 8785370365424849000,
"line_mean": 33.536121673,
"line_max": 78,
"alpha_frac": 0.6482439723,
"autogenerated": false,
"ratio": 3.6029353431178106,
"co... |
from django.test import TestCase
from django.contrib.auth.models import User
from models import *
import random
import datetime
from decimal import *
alphabet = [chr(i) for i in range(97,123)]
def random_name():
return ''.join([random.choice(alphabet) for i in range (10)])
def random_date():
random_second = rando... | {
"repo_name": "RedwoodAdmin/RedwoodFramework",
"path": "expecon/tests.py",
"copies": "1",
"size": "1415",
"license": "bsd-2-clause",
"hash": 4599620333608591400,
"line_mean": 31.1590909091,
"line_max": 89,
"alpha_frac": 0.6975265018,
"autogenerated": false,
"ratio": 3.2379862700228834,
"config_... |
from django.test import TestCase
from django.contrib.auth.models import User
from qsstats import QuerySetStats, InvalidInterval, DateFieldMissing, QuerySetMissing
import datetime
class QuerySetStatsTestCase(TestCase):
def test_basic_today(self):
# We'll be making sure that this user is found
u1 = U... | {
"repo_name": "mcroydon/django-qsstats",
"path": "qsstats/tests.py",
"copies": "1",
"size": "3148",
"license": "bsd-3-clause",
"hash": -4849419542865253000,
"line_mean": 35.6046511628,
"line_max": 95,
"alpha_frac": 0.6003811944,
"autogenerated": false,
"ratio": 3.5331088664421997,
"config_test"... |
from django.test import TestCase
from django.contrib.auth.models import User
from rest_framework.test import APIRequestFactory, force_authenticate, APITestCase
from views import UserViewSet, MigrateAndLogin
from django.core.urlresolvers import reverse, resolve
from hashlib import md5
from models import OldPassword
c... | {
"repo_name": "ThreeDRadio/playlists",
"path": "backend/session/test_migrate_and_login.py",
"copies": "1",
"size": "3547",
"license": "mit",
"hash": -1433182815044063500,
"line_mean": 42.256097561,
"line_max": 97,
"alpha_frac": 0.7211728221,
"autogenerated": false,
"ratio": 3.8304535637149026,
... |
from django.test import TestCase
from django.contrib.auth.models import User
from rest_framework.test import APIRequestFactory, force_authenticate, APITestCase
from views import UserViewSet
from django.core.urlresolvers import reverse, resolve
class UserViewSetTest(APITestCase):
def setUp(self):
self.user = Use... | {
"repo_name": "ThreeDRadio/playlists",
"path": "backend/session/test_user_viewset.py",
"copies": "1",
"size": "3450",
"license": "mit",
"hash": 5865313345314591000,
"line_mean": 38.2045454545,
"line_max": 86,
"alpha_frac": 0.6942028986,
"autogenerated": false,
"ratio": 3.6819637139807897,
"conf... |
from django.test import TestCase
from django.contrib.auth.models import User
from rest_framework.test import APIRequestFactory, force_authenticate
from .models import Post, Tag
from .serializers import TopicSerializer
from .views import TagList, TopicDetail, AnyPostDetail
class TagTestCase(TestCase):
def setUp(s... | {
"repo_name": "Aurora0000/descant",
"path": "forums/tests.py",
"copies": "1",
"size": "3592",
"license": "mit",
"hash": 1529163246565512700,
"line_mean": 41.2588235294,
"line_max": 105,
"alpha_frac": 0.6430957684,
"autogenerated": false,
"ratio": 3.5884115884115886,
"config_test": true,
"has_... |
from django.test import TestCase
from django.contrib.auth.models import User
from rest_framework.test import APITestCase
from model_mommy import mommy
from shared_schema_tenants.helpers.tenant_relationships import create_relationship
from shared_schema_tenants.helpers.tenants import (
set_current_tenant, create_de... | {
"repo_name": "hugobessa/django-shared-schema-tenants",
"path": "tests/utils.py",
"copies": "1",
"size": "1670",
"license": "mit",
"hash": -6407817937128785000,
"line_mean": 41.8205128205,
"line_max": 86,
"alpha_frac": 0.6365269461,
"autogenerated": false,
"ratio": 4.260204081632653,
"config_te... |
from django.test import TestCase
from django.contrib.auth.models import User
from rpg_base.models import *
class DndClassTestCase(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
class RaceTestCase(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
... | {
"repo_name": "ncphillips/django_rpg",
"path": "rpg_base/tests/test_characters.py",
"copies": "1",
"size": "5595",
"license": "mit",
"hash": -7243016363621378000,
"line_mean": 31.5290697674,
"line_max": 118,
"alpha_frac": 0.6196604111,
"autogenerated": false,
"ratio": 3.652088772845953,
"config... |
from django.test import TestCase
from django.contrib.auth.models import User
from securedpi_profile.models import SecuredpiProfile
from django.urls import reverse
class SecurepiProfileTestCase(TestCase):
"""Create test class for SecuredpiProfile model."""
def setUp(self):
"""Set up a fake user."""
... | {
"repo_name": "Secured-Pi/Secured-Pi",
"path": "securedpi_profile/tests.py",
"copies": "1",
"size": "5781",
"license": "mit",
"hash": 915358495497949300,
"line_mean": 35.821656051,
"line_max": 76,
"alpha_frac": 0.6030098599,
"autogenerated": false,
"ratio": 4.0941926345609065,
"config_test": tr... |
from django.test import TestCase
from django.contrib.auth.models import User
from vodkamartiniarticle.models import Article
from vodkamartinicategory.models import Category
from django.core import management
from StringIO import StringIO
import re
class ArticleCommandsTest(TestCase):
def setUp(self):
self... | {
"repo_name": "alexisbellido/django-vodkamartini-article",
"path": "vodkamartiniarticle/tests/management.py",
"copies": "1",
"size": "2437",
"license": "bsd-3-clause",
"hash": -6228873154150161000,
"line_mean": 45.8653846154,
"line_max": 171,
"alpha_frac": 0.6663931063,
"autogenerated": false,
"r... |
from django.test import TestCase
from django.contrib.auth.models import User
import test_factories
class TestApproval(TestCase):
def setUp(self):
self.user = test_factories.UserFactory(username='admin')
self.contributor = test_factories.UserFactory(username='contrib')
self.joe = test_facto... | {
"repo_name": "jnayak1/osf-meetings",
"path": "meetings/approvals/tests.py",
"copies": "2",
"size": "2510",
"license": "apache-2.0",
"hash": -6896727445217165000,
"line_mean": 42.275862069,
"line_max": 80,
"alpha_frac": 0.6589641434,
"autogenerated": false,
"ratio": 4.204355108877722,
"config_t... |
from django.test import TestCase
from django.contrib.auth.models import User
class AnonymousUserTestCase(TestCase):
'''Test cases for anonymous (non-authenticated) users'''
def test_anon_user_can_visit_home(self):
'''Ensure the anonymous user is redirected to /login when visiting the root'''
re... | {
"repo_name": "MetaArchive/etd-drop",
"path": "etd_drop_app/tests.py",
"copies": "1",
"size": "3199",
"license": "bsd-3-clause",
"hash": -3674727100386089000,
"line_mean": 43.4444444444,
"line_max": 86,
"alpha_frac": 0.6723976243,
"autogenerated": false,
"ratio": 4.18717277486911,
"config_test"... |
from django.test import TestCase
from django.contrib.auth.models import User
class SpecialHeadersTest(TestCase):
fixtures = ['data.xml']
def test_xheaders(self):
user = User.objects.get(username='super')
response = self.client.get('/special_headers/article/1/')
# import pdb; pdb.set_tr... | {
"repo_name": "djangorussia/django-1.3-branch",
"path": "tests/regressiontests/special_headers/tests.py",
"copies": "51",
"size": "2594",
"license": "bsd-3-clause",
"hash": -682272721790544300,
"line_mean": 42.9661016949,
"line_max": 96,
"alpha_frac": 0.6391673092,
"autogenerated": false,
"ratio"... |
from django.test import TestCase
from django.contrib.auth.models import User
from avocado.criteria.models import Criterion
__all__ = ('CriterionSearchTestCase',)
class CriterionSearchTestCase(TestCase):
fixtures = ['test_data.yaml']
def test_fulltext(self):
queryset1 = Criterion.objects.fulltext_sea... | {
"repo_name": "pombredanne/django-avocado",
"path": "avocado/criteria/tests/models.py",
"copies": "1",
"size": "2907",
"license": "bsd-3-clause",
"hash": -7167428832409341000,
"line_mean": 62.1956521739,
"line_max": 301,
"alpha_frac": 0.6965944272,
"autogenerated": false,
"ratio": 3.42,
"config... |
from django.test import TestCase
from django.contrib.auth.models import User
from ..connections import follow, unfollow, is_following, followers, following
from ..models import Follow
class ConnectionsTest(TestCase):
def setUp(self):
self.me = User.objects.create_user(
username="mohamed",
email="turkipro@gm... | {
"repo_name": "mohamedturki/django-newsfeed",
"path": "django_newsfeed/tests/test_connections.py",
"copies": "2",
"size": "1053",
"license": "mit",
"hash": 5599979608685610000,
"line_mean": 22.9545454545,
"line_max": 78,
"alpha_frac": 0.7122507123,
"autogenerated": false,
"ratio": 2.9088397790055... |
from django.test import TestCase
from django.contrib.auth.models import User
from corehq.apps.users.dbaccessors.all_commcare_users import delete_all_users
from corehq.apps.users.models import CouchUser, CommCareUser
from corehq.apps.domain.models import Domain
class UpdateTestCase(TestCase):
def setUp(self):
... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "corehq/apps/users/tests/update.py",
"copies": "1",
"size": "2466",
"license": "bsd-3-clause",
"hash": -314335954862536260,
"line_mean": 45.5283018868,
"line_max": 106,
"alpha_frac": 0.6861313869,
"autogenerated": false,
"ratio": 3.478138222849083,... |
from django.test import TestCase
from django.contrib.auth.models import User
from core.models import (RecipeCondition, Recipe, TriggerInput, Trigger, Action,
ActionInput, RecipeMapping, TriggerOutput, Channel)
class BaseTest(TestCase):
def setUp(self):
self.user = self.create_us... | {
"repo_name": "daisychainme/daisychain",
"path": "daisychain/channel_rss/tests/test_base.py",
"copies": "1",
"size": "4351",
"license": "mit",
"hash": 5767466417269229000,
"line_mean": 40.0566037736,
"line_max": 80,
"alpha_frac": 0.538267065,
"autogenerated": false,
"ratio": 4.668454935622318,
... |
from django.test import TestCase
from django.contrib.auth.models import User
from datastore import models
from datetime import datetime
class ConsumptionRecordTestCase(TestCase):
def setUp(self):
user = User.objects.create_user('john', 'lennon@thebeatles.com',
'j... | {
"repo_name": "impactlab/oeem-energy-datastore",
"path": "datastore/tests/models/test_consumption_record.py",
"copies": "1",
"size": "1253",
"license": "mit",
"hash": -1347958572559454500,
"line_mean": 28.8333333333,
"line_max": 73,
"alpha_frac": 0.5897845172,
"autogenerated": false,
"ratio": 4.5... |
from django.test import TestCase
from django.contrib.auth.models import User
from datastore import models
from eemeter.structures import EnergyTrace
class ConsumptionMetadataTestCase(TestCase):
def setUp(self):
user = User.objects.create_user('john', 'lennon@thebeatles.com',
... | {
"repo_name": "impactlab/oeem-energy-datastore",
"path": "datastore/tests/models/test_consumption_metadata.py",
"copies": "1",
"size": "1111",
"license": "mit",
"hash": 2174325120535458600,
"line_mean": 29.027027027,
"line_max": 77,
"alpha_frac": 0.603960396,
"autogenerated": false,
"ratio": 4.46... |
from django.test import TestCase
from django.contrib.auth.models import User
from datetime import date
from decimal import Decimal
from mentha.models import Account, Transaction, Payee
class TransactionTestCase(TestCase):
def setUp(self):
self.test_user = User.objects.create_user('Fakey Fakerson', 'fake@test.com... | {
"repo_name": "ateoto/django-mentha",
"path": "mentha/tests/test_models.py",
"copies": "1",
"size": "1741",
"license": "mit",
"hash": 3177310476245789000,
"line_mean": 50.2058823529,
"line_max": 140,
"alpha_frac": 0.7576105686,
"autogenerated": false,
"ratio": 2.955857385398981,
"config_test": ... |
from django.test import TestCase
from django.contrib.auth.models import User
from datetime import datetime
import pytz
from datastore.services import create_project, diagnostic_export
from datastore import models
from datastore import tasks
class DiagnosticExportServiceTestCase(TestCase):
def setUp(self):
... | {
"repo_name": "impactlab/oeem-energy-datastore",
"path": "datastore/tests/services/test_diagnostic_export.py",
"copies": "1",
"size": "3478",
"license": "mit",
"hash": 7839179262672068000,
"line_mean": 36.8043478261,
"line_max": 76,
"alpha_frac": 0.4939620472,
"autogenerated": false,
"ratio": 3.9... |
from django.test import TestCase
from django.contrib.auth.models import User
from datetime import datetime
import pytz
from datastore.services import create_project, projectresult_export
class ExportServiceTestCase(TestCase):
def setUp(self):
user = User.objects.create_user(
'john', 'lenno... | {
"repo_name": "impactlab/oeem-energy-datastore",
"path": "datastore/tests/services/test_projectresult_export.py",
"copies": "1",
"size": "2106",
"license": "mit",
"hash": -1700188723990183200,
"line_mean": 32.4285714286,
"line_max": 76,
"alpha_frac": 0.4240265907,
"autogenerated": false,
"ratio":... |
from django.test import TestCase
from django.contrib.auth.models import User
from miot.models import Template, Category, Profile
class TemplateTestCase(TestCase):
'''Test the ability to create a template.'''
def create_template(self):
return Template.objects.create(name="TestTemplate", short_descripti... | {
"repo_name": "Ishydo/miot",
"path": "miot/tests.py",
"copies": "1",
"size": "1312",
"license": "mit",
"hash": 7893398872892305000,
"line_mean": 36.4857142857,
"line_max": 107,
"alpha_frac": 0.6913109756,
"autogenerated": false,
"ratio": 3.9757575757575756,
"config_test": true,
"has_no_keywor... |
from django.test import TestCase
from django.contrib.auth.models import User
from .models import UserProfile
from testpilot.utils import cleanup_nonstaff_users
from testpilot.experiments.models import Experiment
import logging
logger = logging.getLogger(__name__)
class UserProfileTests(TestCase):
maxDiff = No... | {
"repo_name": "ckprice/testpilot",
"path": "testpilot/users/tests.py",
"copies": "1",
"size": "2995",
"license": "mpl-2.0",
"hash": 8331459727036056000,
"line_mean": 35.975308642,
"line_max": 89,
"alpha_frac": 0.6657762938,
"autogenerated": false,
"ratio": 3.9721485411140582,
"config_test": tru... |
from django.test import TestCase
from django.contrib.auth.models import User
from molo.profiles.forms import (
ForgotPasswordForm, RegistrationForm, ProfilePasswordChangeForm)
from molo.core.tests.base import MoloTestCaseMixin
from molo.profiles.models import SecurityQuestion, SecurityQuestionIndexPage
class Reg... | {
"repo_name": "praekelt/molo.profiles",
"path": "molo/profiles/tests/test_forms.py",
"copies": "1",
"size": "4574",
"license": "bsd-2-clause",
"hash": 7080448444376661000,
"line_mean": 29.2913907285,
"line_max": 76,
"alpha_frac": 0.559029296,
"autogenerated": false,
"ratio": 4.207911683532659,
... |
from django.test import TestCase
from django.contrib.auth.models import User
from projects.models import Project
from projects.forms import UpdateProjectForm
class Testmaker(TestCase):
fixtures = ["eric"]
def test_imported_docs(self):
# Test Import
self.client.login(username='eric', password... | {
"repo_name": "sils1297/readthedocs.org",
"path": "readthedocs/rtd_tests/tests/test_views.py",
"copies": "10",
"size": "1857",
"license": "mit",
"hash": 2924692705095601000,
"line_mean": 39.3695652174,
"line_max": 70,
"alpha_frac": 0.5939687668,
"autogenerated": false,
"ratio": 3.626953125,
"co... |
from django.test import TestCase
from django.contrib.auth.models import User
from proposal.models import Proposal, ProposalType, AudienceLevel, Category
from proposal.forms import ProposalForm
class ProposalFormTest(TestCase):
fixtures = ['proposal_types.json',
'categories.json',
... | {
"repo_name": "arscariosus/django-mango",
"path": "mango/apps/proposal/tests/forms.py",
"copies": "1",
"size": "2345",
"license": "isc",
"hash": 795918116224628600,
"line_mean": 38.0833333333,
"line_max": 75,
"alpha_frac": 0.5620469083,
"autogenerated": false,
"ratio": 4.165186500888099,
"confi... |
from django.test import TestCase
from django.contrib.auth.models import User
from sfmmanager.storage_utils import ResourceData, UserData
import os
# base test case for authenticated views testing
class AuthUserTestCase(TestCase):
def setUp(self):
#create dummy user
self.user = User.objects.c... | {
"repo_name": "qwattash/uclvr-backend",
"path": "sfmmanager/tests/base.py",
"copies": "1",
"size": "1131",
"license": "mit",
"hash": 5737198038819066000,
"line_mean": 26.5853658537,
"line_max": 76,
"alpha_frac": 0.6489832007,
"autogenerated": false,
"ratio": 3.833898305084746,
"config_test": tr... |
from django.test import TestCase
from django.contrib.auth.models import User
from Snack.models import Profil, Type, Product, Purchase
class TestHistory(TestCase):
def setUp(self):
self.user = User.objects.create(username='user', password='test')
self.user.set_password('test')
self.user.s... | {
"repo_name": "AIR-EISTI/Market_Manager_V2",
"path": "Snack/tests/test_history.py",
"copies": "1",
"size": "1670",
"license": "bsd-2-clause",
"hash": -6336396398908321000,
"line_mean": 29.9259259259,
"line_max": 80,
"alpha_frac": 0.5862275449,
"autogenerated": false,
"ratio": 3.686534216335541,
... |
from django.test import TestCase
from django.contrib.auth.models import User
from test_generator.views import TestViewMixin
from daiquiri.core.utils import setup_group
from ..models import Meeting, Participant
class MeetingsViewTestCase(TestCase):
fixtures = (
'auth.json',
'meetings.json'
... | {
"repo_name": "aipescience/django-daiquiri",
"path": "daiquiri/meetings/tests/test_views.py",
"copies": "1",
"size": "8865",
"license": "apache-2.0",
"hash": -4165668814095027700,
"line_mean": 31.1195652174,
"line_max": 619,
"alpha_frac": 0.5960518895,
"autogenerated": false,
"ratio": 3.710757639... |
from django.test import TestCase
from django.contrib.auth.models import User
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):
eve... | {
"repo_name": "lojack/wagtail",
"path": "wagtail/wagtailcore/tests/test_page_permissions.py",
"copies": "1",
"size": "15898",
"license": "bsd-3-clause",
"hash": 4813902813013437000,
"line_mean": 51.8172757475,
"line_max": 163,
"alpha_frac": 0.7055604479,
"autogenerated": false,
"ratio": 3.6471667... |
from django.test import TestCase
from django.contrib.auth.models import User
class BaseTestCase(TestCase):
def assertObject(self, instance, **params):
"""
Asserts that object have given attributes of given values.
Sample usage:
# Fetches user from DB and asserts that username... | {
"repo_name": "elegion/djangodash2012",
"path": "core/tests.py",
"copies": "1",
"size": "2149",
"license": "mit",
"hash": -813788232571280900,
"line_mean": 36.701754386,
"line_max": 150,
"alpha_frac": 0.610981852,
"autogenerated": false,
"ratio": 4.467775467775468,
"config_test": false,
"has_... |
from django.test import TestCase
from django.contrib.auth.models import User, Permission
from django.contrib.contenttypes.models import ContentType
from django.conf import settings
class ProtectedFileTest(TestCase):
urls = 'protected_files.tests.urls'
def setUp(self):
super(ProtectedFileTest, sel... | {
"repo_name": "lincolnloop/django-protected-files",
"path": "protected_files/tests/tests.py",
"copies": "1",
"size": "3548",
"license": "bsd-3-clause",
"hash": -6961541592554070000,
"line_mean": 43.3625,
"line_max": 92,
"alpha_frac": 0.6186583991,
"autogenerated": false,
"ratio": 4.14002333722287... |
from django.test import TestCase
from django.contrib.auth.models import User,Permission
from django.contrib.contenttypes.models import ContentType
from denorm.denorms import install_triggers
import denorm
from models import Attachment, Post, Forum, Member, Tag
class TestDenormalisation(TestCase):
"""
Tests fo... | {
"repo_name": "victorvde/django-denorm",
"path": "test_project/test_app/tests.py",
"copies": "1",
"size": "12736",
"license": "bsd-3-clause",
"hash": -8517345469108803000,
"line_mean": 36.7922848665,
"line_max": 111,
"alpha_frac": 0.6352072864,
"autogenerated": false,
"ratio": 3.1895817680941647,... |
from django.test import TestCase
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import Group
from actstream.models import Action
from actstream.compat import get_user_model
from actstream.tests.base import LTE
class GFKManagerTestCase(TestCase):
def setUp(self):
... | {
"repo_name": "pombredanne/django-activity-stream",
"path": "actstream/tests/test_gfk.py",
"copies": "3",
"size": "4232",
"license": "bsd-3-clause",
"hash": -580262753537862300,
"line_mean": 43.5473684211,
"line_max": 78,
"alpha_frac": 0.5961720227,
"autogenerated": false,
"ratio": 3.809180918091... |
from django.test import TestCase
from django.contrib.contenttypes.models import ContentType
from django.contrib.comments.models import Comment
from tagging.models import TaggedItem
from wiki.models import Article
from ct_groups.models import CTGroup
TESTPASS='testpass'
class PageTest(TestCase):
"""test a few page... | {
"repo_name": "freshehr/ct-snowhite",
"path": "snowhite/apps/home/tests.py",
"copies": "2",
"size": "4559",
"license": "bsd-3-clause",
"hash": -5309130997486145000,
"line_mean": 42.8461538462,
"line_max": 92,
"alpha_frac": 0.5922351393,
"autogenerated": false,
"ratio": 3.923407917383821,
"confi... |
from django.test import TestCase
from django.contrib.contenttypes.models import ContentType
from janitor import whitelists
from janitor.models import FieldSanitizer
class TestJanitor(TestCase):
@classmethod
def setUpTestData(cls):
# Hack: Use the FieldSanitizer models as the target, so we get a
... | {
"repo_name": "bradmontgomery/django-janitor",
"path": "janitor/tests/test_models.py",
"copies": "1",
"size": "4007",
"license": "mit",
"hash": 2639869564233747000,
"line_mean": 32.6722689076,
"line_max": 79,
"alpha_frac": 0.5690042426,
"autogenerated": false,
"ratio": 3.5523049645390072,
"conf... |
from django.test import TestCase
from django.contrib.contenttypes.models import ContentType
from .models import SourceType, Bibliography, Footnote
class TestSourceType(TestCase):
def test_item_count(self):
src_type = SourceType.objects.first()
assert src_type.item_count() == 0
bibl = Bi... | {
"repo_name": "Princeton-CDH/winthrop-django",
"path": "winthrop/footnotes/tests.py",
"copies": "1",
"size": "1865",
"license": "apache-2.0",
"hash": -5422154496225951000,
"line_mean": 34.8653846154,
"line_max": 93,
"alpha_frac": 0.6648793566,
"autogenerated": false,
"ratio": 3.7753036437246963,
... |
from django.test import TestCase
from django.contrib.gis.geos import LineString, Point
from django.conf import settings
from unittest import skipIf
from geotrek.core.factories import PathFactory, TopologyFactory, NetworkFactory, UsageFactory
from geotrek.core.models import Path, Topology
@skipIf(not settings.TREKKI... | {
"repo_name": "makinacorpus/Geotrek",
"path": "geotrek/core/tests/test_path_split.py",
"copies": "2",
"size": "66079",
"license": "bsd-2-clause",
"hash": -7283296780778577000,
"line_mean": 42.1043705153,
"line_max": 135,
"alpha_frac": 0.5097837437,
"autogenerated": false,
"ratio": 3.5150273950742... |
from django.test import TestCase
from django.contrib.gis.geos import (LineString, Polygon, MultiPolygon,
MultiLineString, MultiPoint, Point)
from django.core.exceptions import ValidationError
from django.conf import settings
from django.test.utils import override_settings
from unit... | {
"repo_name": "makinacorpus/Geotrek",
"path": "geotrek/trekking/tests/test_models.py",
"copies": "2",
"size": "20727",
"license": "bsd-2-clause",
"hash": 7709296544158958000,
"line_mean": 43.6702586207,
"line_max": 122,
"alpha_frac": 0.6272494814,
"autogenerated": false,
"ratio": 3.22649439601494... |
from django.test import TestCase
from django.contrib.gis.geos import (LineString, Polygon, MultiPolygon,
MultiLineString)
from django.core.exceptions import ValidationError
from bs4 import BeautifulSoup
from geotrek.common.tests import TranslationResetMixin
from geotrek.core.facto... | {
"repo_name": "johan--/Geotrek",
"path": "geotrek/trekking/tests/test_models.py",
"copies": "1",
"size": "11853",
"license": "bsd-2-clause",
"hash": 1246138222369828400,
"line_mean": 39.7319587629,
"line_max": 122,
"alpha_frac": 0.6085379229,
"autogenerated": false,
"ratio": 3.3313659359190555,
... |
from django.test import TestCase
from django.contrib import admin
from django.contrib.contenttypes.models import ContentType
from django.contrib.flatpages.admin import FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.conf import settings
from admin_extras.utils import get_models, apps, ad... | {
"repo_name": "MichalMaM/django-admin-extras",
"path": "tests/test_utils.py",
"copies": "1",
"size": "1987",
"license": "bsd-2-clause",
"hash": 6272120335454217000,
"line_mean": 40.3958333333,
"line_max": 128,
"alpha_frac": 0.7020634122,
"autogenerated": false,
"ratio": 3.58018018018018,
"confi... |
from django.test import TestCase
from django.contrib import comments
from django_comments_xtd.models import TmpXtdComment
from django_comments_xtd.forms import XtdCommentForm
from django_comments_xtd.tests.models import Article
class GetFormTestCase(TestCase):
def test_get_form(self):
# check function d... | {
"repo_name": "CantemoInternal/django-comments-xtd",
"path": "django_comments_xtd/tests/forms.py",
"copies": "1",
"size": "1793",
"license": "bsd-2-clause",
"hash": -6276256022173693000,
"line_mean": 37.9782608696,
"line_max": 80,
"alpha_frac": 0.6196319018,
"autogenerated": false,
"ratio": 3.958... |
from django.test import TestCase
from django.contrib.sites.models import Site
from django.utils import unittest
from django.conf import settings
from .factories import GalleryFactory, PhotoFactory
class SitesTest(TestCase):
urls = 'photologue.tests.test_urls'
def setUp(self):
"""
Create two... | {
"repo_name": "anderdl/test3repo",
"path": "photologue/tests/test_sites.py",
"copies": "2",
"size": "5750",
"license": "bsd-3-clause",
"hash": 7826552420541646000,
"line_mean": 40.3669064748,
"line_max": 103,
"alpha_frac": 0.6229565217,
"autogenerated": false,
"ratio": 3.8983050847457625,
"conf... |
from django.test import TestCase
from django.contrib.sites.models import Site
from feeds.models import Activity, Feed
class FeedsTestCase(TestCase):
def setUp(self):
self.site = Site.objects.all()[0]
def test_activity(self):
a = Activity.objects.create(
self.site,
'si... | {
"repo_name": "rvause/django-generic-feeds",
"path": "feeds/tests/tests.py",
"copies": "1",
"size": "1576",
"license": "bsd-2-clause",
"hash": 2553555921146473000,
"line_mean": 24.0158730159,
"line_max": 73,
"alpha_frac": 0.5069796954,
"autogenerated": false,
"ratio": 4.213903743315508,
"config... |
from django.test import TestCase
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.core.urlresolvers import reverse
from selenium import webdriver
from rango.decorators import chapter15
# Create your tests here.
class Chapter15ViewTests(TestCase):
@chapter15
def test_search_us... | {
"repo_name": "leifos/tango_with_tests",
"path": "tango_with_django_project/ch15tests/tests.py",
"copies": "1",
"size": "3211",
"license": "mit",
"hash": 6538197721263376000,
"line_mean": 33.1595744681,
"line_max": 106,
"alpha_frac": 0.6418561196,
"autogenerated": false,
"ratio": 4.21944809461235... |
from django.test import TestCase
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from rango.models import User, UserProfile, Category
from rango.forms import UserForm, UserProfileForm
import test_utils
from selenium.webdriver.common.keys import Keys
from selenium import webdriver
from django.cor... | {
"repo_name": "leifos/tango_with_tests",
"path": "tango_with_django_project/ch9tests/tests.py",
"copies": "1",
"size": "12876",
"license": "mit",
"hash": -4349852447075731000,
"line_mean": 34.1803278689,
"line_max": 105,
"alpha_frac": 0.6431345138,
"autogenerated": false,
"ratio": 4.0376293508936... |
from django.test import TestCase
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
import test_utils
from django.core.urlresolvers import reverse, NoReverseMatch
from selenium.webdriver.common.keys import Keys
class Chapter12LiveServerTests(StaticLiveServerTestCase)... | {
"repo_name": "leifos/tango_with_tests",
"path": "tango_with_django_project/ch12tests/tests.py",
"copies": "1",
"size": "6880",
"license": "mit",
"hash": -2388463693998694400,
"line_mean": 35.4074074074,
"line_max": 92,
"alpha_frac": 0.6422965116,
"autogenerated": false,
"ratio": 4.16969696969697... |
from django.test import TestCase
from django.core.cache import cache as mcache
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from avocado.store.models import Scope, Perspective, Report
__all__ = ('ScopeTestCase', 'PerspectiveTestCase', 'ReportTestCase')
class ScopeTestCase(... | {
"repo_name": "pombredanne/django-avocado",
"path": "avocado/store/tests/models.py",
"copies": "1",
"size": "4138",
"license": "bsd-3-clause",
"hash": -8590087984013555000,
"line_mean": 27.5379310345,
"line_max": 73,
"alpha_frac": 0.607781537,
"autogenerated": false,
"ratio": 3.8564771668219944,
... |
from django.test import TestCase
from django.core.cache import cache
from django.contrib.auth.models import User
class BasicViews(TestCase):
def setUp(self):
"""
Create editor user and some data to use for creating quiz related objects.
"""
cache.clear()
self.regular_user =... | {
"repo_name": "alexisbellido/django-vodkamartini-quiz",
"path": "vodkamartiniquiz/tests/view_tests.py",
"copies": "1",
"size": "1293",
"license": "bsd-3-clause",
"hash": -6116105042556128000,
"line_mean": 33.9459459459,
"line_max": 105,
"alpha_frac": 0.6388244393,
"autogenerated": false,
"ratio":... |
from django.test import TestCase
from django.core.cache import cache
from django.test.client import RequestFactory
from django.core.files.uploadhandler import load_handler
from time import sleep
class ProgressBarUploadHandlerTest(TestCase):
def setUp(self):
# set up request factory
self.factory = ... | {
"repo_name": "CydarLtd/django-progressbarupload",
"path": "progressbarupload/tests/tests.py",
"copies": "1",
"size": "1276",
"license": "bsd-3-clause",
"hash": -5905887364118442000,
"line_mean": 38.875,
"line_max": 71,
"alpha_frac": 0.6504702194,
"autogenerated": false,
"ratio": 3.82035928143712... |
from django.test import TestCase
from django.core.cache import cache
from django.test.client import RequestFactory
from django.core.files.uploadhandler import load_handler
class ProgressBarUploadHandlerTest(TestCase):
def setUp(self):
# set up request factory
self.factory = RequestFactory()
d... | {
"repo_name": "foobarbecue/afterflight",
"path": "afterflight/progressbarupload/tests/tests.py",
"copies": "2",
"size": "1237",
"license": "apache-2.0",
"hash": 8930201376759831000,
"line_mean": 40.2333333333,
"line_max": 71,
"alpha_frac": 0.6515763945,
"autogenerated": false,
"ratio": 3.81790123... |
from django.test import TestCase
from django.core.cache import cache
from cachetask.base import CacheTask
from cachetask.tests.testapp.models import MyModel, MyGreedyModel
class MyTask(CacheTask):
called_async = False
def run(self):
return [1, 2, 3]
def async_refresh(self, *args, **kwargs):
... | {
"repo_name": "eofs/django-cachetask",
"path": "cachetask/tests/query.py",
"copies": "1",
"size": "2595",
"license": "bsd-2-clause",
"hash": -372241677484213600,
"line_mean": 30.6463414634,
"line_max": 90,
"alpha_frac": 0.6138728324,
"autogenerated": false,
"ratio": 4.119047619047619,
"config_t... |
from django.test import TestCase
from django.core.cache import cache
from wagtail.wagtailcore.models import Page, PageViewRestriction, Site
from wagtail.tests.models import SimplePage, EventIndex
from .sitemap_generator import Sitemap
class TestSitemapGenerator(TestCase):
def setUp(self):
self.home_page... | {
"repo_name": "chimeno/wagtail",
"path": "wagtail/contrib/wagtailsitemaps/tests.py",
"copies": "3",
"size": "3867",
"license": "bsd-3-clause",
"hash": -1131726876728346600,
"line_mean": 34.8055555556,
"line_max": 118,
"alpha_frac": 0.6477889837,
"autogenerated": false,
"ratio": 3.9824922760041193... |
from django.test import TestCase
from django.core.cache import cache
from wagtail.wagtailcore.models import Page, PageViewRestriction, Site
from wagtail.tests.testapp.models import SimplePage, EventIndex
from .sitemap_generator import Sitemap
class TestSitemapGenerator(TestCase):
def setUp(self):
self.h... | {
"repo_name": "JoshBarr/wagtail",
"path": "wagtail/contrib/wagtailsitemaps/tests.py",
"copies": "3",
"size": "3848",
"license": "bsd-3-clause",
"hash": -6159581601285104000,
"line_mean": 34.6296296296,
"line_max": 119,
"alpha_frac": 0.6465696466,
"autogenerated": false,
"ratio": 3.983436853002070... |
from django.test import TestCase
from django.core.cache import cache
import urlparse
class HttpCodeTestCase(TestCase):
# TODO: this should be a private method.
def assertHttpCode(self, response, code, code_description):
self.assertEqual(
response.status_code, code,
"Expected a... | {
"repo_name": "janusnic/django-test-mixins",
"path": "django_test_mixins.py",
"copies": "1",
"size": "3919",
"license": "mit",
"hash": -8627004541235092000,
"line_mean": 33.3771929825,
"line_max": 94,
"alpha_frac": 0.631793825,
"autogenerated": false,
"ratio": 4.4282485875706215,
"config_test":... |
from django.test import TestCase
from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
from django.utils import timezone
from appengine_toolkit.storage import GoogleCloudStorage
from google.appe... | {
"repo_name": "masci/django-appengine-toolkit",
"path": "tests/test_storage.py",
"copies": "1",
"size": "3679",
"license": "bsd-3-clause",
"hash": -7573642726029782000,
"line_mean": 36.9381443299,
"line_max": 97,
"alpha_frac": 0.6621364501,
"autogenerated": false,
"ratio": 3.998913043478261,
"c... |
from django.test import TestCase
from django.core.exceptions import ObjectDoesNotExist
from .models import DimCalendar
from datetime import date
from dateutil import easter
from workalendar.core import WesternCalendar, ChristianMixin
import workalendar.europe
class ChristianCalendarTester(WesternCalendar, ChristianMi... | {
"repo_name": "gregn610/dimcal",
"path": "src/dimcal/dcal/tests_christian.py",
"copies": "1",
"size": "7882",
"license": "unlicense",
"hash": -4575224175919244000,
"line_mean": 32.9784482759,
"line_max": 106,
"alpha_frac": 0.6155798021,
"autogenerated": false,
"ratio": 3.2923976608187133,
"conf... |
from django.test import TestCase
from django.core.exceptions import ObjectDoesNotExist
from .models import DimCalendar
from datetime import date
from workalendar.core import Calendar, MON, TUE, WED, THU, FRI, SAT, SUN
import workalendar.europe
import workalendar.africa
import workalendar.america
class DimCalendarHolid... | {
"repo_name": "gregn610/dimcal",
"path": "src/dimcal/dcal/tests_to_db.py",
"copies": "1",
"size": "15851",
"license": "unlicense",
"hash": -3984547777874725000,
"line_mean": 35.6921296296,
"line_max": 109,
"alpha_frac": 0.5705002839,
"autogenerated": false,
"ratio": 3.5177541056369286,
"config_... |
from django.test import TestCase
from django.core.exceptions import ObjectDoesNotExist
from django_softdeletion.models import SoftDeleteManager, SoftDeleteQuerySet
from .project.app.models import Foo, Bar, Baz
class SoftDeletionTestCase(TestCase):
def test_single_object(self):
foo = Foo.objects.create()... | {
"repo_name": "pmuller/django-softdeletion",
"path": "tests/test_models.py",
"copies": "1",
"size": "2891",
"license": "mit",
"hash": -6584137776175228000,
"line_mean": 30.0860215054,
"line_max": 76,
"alpha_frac": 0.6191629194,
"autogenerated": false,
"ratio": 3.6875,
"config_test": true,
"ha... |
from django.test import TestCase
from django.core.exceptions import PermissionDenied
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_... | {
"repo_name": "FescueFungiShare/hydroshare",
"path": "hs_access_control/tests/test_preserve_ownership.py",
"copies": "1",
"size": "3478",
"license": "bsd-3-clause",
"hash": 8255897796797530000,
"line_mean": 32.1238095238,
"line_max": 77,
"alpha_frac": 0.5899942496,
"autogenerated": false,
"ratio"... |
from django.test import TestCase
from django.core.exceptions import PermissionDenied
from nose.tools import raises
from geokey.projects.tests.model_factories import UserF
from .model_factories import ApplicationFactory
from ..models import Application
class ApplicationManagerTest(TestCase):
def setUp(self):
... | {
"repo_name": "nagyistoce/geokey",
"path": "geokey/applications/tests/test_manager.py",
"copies": "1",
"size": "1564",
"license": "apache-2.0",
"hash": 4490455238272045000,
"line_mean": 30.28,
"line_max": 68,
"alpha_frac": 0.641943734,
"autogenerated": false,
"ratio": 3.706161137440758,
"config... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.