text stringlengths 0 1.05M | meta dict |
|---|---|
from django.test import TestCase
from djangorestframework.compat import RequestFactory
from djangorestframework.mixins import RequestMixin
class TestMethodOverloading(TestCase):
def setUp(self):
self.req = RequestFactory()
def test_standard_behaviour_determines_GET(self):
"""GET requests iden... | {
"repo_name": "seanfisk/buzzword-bingo-server",
"path": "djangorestframework/tests/methods.py",
"copies": "1",
"size": "1185",
"license": "bsd-3-clause",
"hash": -7884693564289504000,
"line_mean": 36.03125,
"line_max": 96,
"alpha_frac": 0.6632911392,
"autogenerated": false,
"ratio": 4.11458333333... |
from django.test import TestCase
from djangorestframework.compat import RequestFactory
from djangorestframework.views import View
# See: http://www.useragentstring.com/
MSIE_9_USER_AGENT = 'Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US))'
MSIE_8_USER_AGENT = 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5... | {
"repo_name": "seanfisk/buzzword-bingo-server",
"path": "djangorestframework/tests/accept.py",
"copies": "1",
"size": "3323",
"license": "bsd-3-clause",
"hash": -4789167823172357000,
"line_mean": 50.1230769231,
"line_max": 145,
"alpha_frac": 0.6078844418,
"autogenerated": false,
"ratio": 3.029170... |
from django.test import TestCase
from djangorestframework.views import View
from djangorestframework.compat import apply_markdown
# We check that docstrings get nicely un-indented.
DESCRIPTION = """an example docstring
====================
* list
* list
another header
--------------
code block
indented
# hash... | {
"repo_name": "seanfisk/buzzword-bingo-server",
"path": "djangorestframework/tests/description.py",
"copies": "1",
"size": "3512",
"license": "bsd-3-clause",
"hash": 6783633742257598000,
"line_mean": 30.6396396396,
"line_max": 138,
"alpha_frac": 0.6258542141,
"autogenerated": false,
"ratio": 3.98... |
from django.test import TestCase
from django.shortcuts import resolve_url as r
from djexperience.crm.models import Customer, Occupation
from .data import CUSTOMER_DICT
class CustomerDetailGet(TestCase):
def setUp(self):
self.occupation = Occupation.objects.create(occupation='Vendedor')
self.obj =... | {
"repo_name": "rg3915/django-experience",
"path": "djexperience/crm/tests/test_view_customer_detail.py",
"copies": "1",
"size": "1418",
"license": "mit",
"hash": -1875007726712476000,
"line_mean": 29.8260869565,
"line_max": 78,
"alpha_frac": 0.6403385049,
"autogenerated": false,
"ratio": 3.906336... |
from django.test import TestCase
from django.shortcuts import resolve_url as r
from eventex.core.models import Speaker
class SpeakerModelTest(TestCase):
def setUp(self):
self.speaker = Speaker.objects.create(
name='Grace Hopper',
slug='grace-hopper',
website='http://hb... | {
"repo_name": "rg3915/wttd2",
"path": "eventex/core/tests/test_model_speaker.py",
"copies": "1",
"size": "1032",
"license": "mit",
"hash": -5378722285083376000,
"line_mean": 31.25,
"line_max": 62,
"alpha_frac": 0.6501937984,
"autogenerated": false,
"ratio": 3.6725978647686834,
"config_test": tr... |
from django.test import TestCase
from django.shortcuts import resolve_url as r
from eventex.subscriptions.models import Subscription
class SubscriptionDetailGet(TestCase):
def setUp(self):
self.obj = Subscription.objects.create(
name='Regis da Silva',
cpf='71124336656',
... | {
"repo_name": "rg3915/wttd2",
"path": "eventex/subscriptions/tests/test_view_detail.py",
"copies": "1",
"size": "1373",
"license": "mit",
"hash": -6684698844103009000,
"line_mean": 30.9302325581,
"line_max": 75,
"alpha_frac": 0.634377276,
"autogenerated": false,
"ratio": 3.8245125348189415,
"co... |
from django.test import TestCase
from django.shortcuts import reverse
from django.contrib.auth.models import User
class SignUpViewTestCase(TestCase):
def setUp(self):
self.app_name = 'users'
self.view_name = 'signup'
self.url_name = '{}:{}'.format(self.app_name, self.view_name)
sel... | {
"repo_name": "wencakisa/mashup",
"path": "users/tests.py",
"copies": "1",
"size": "5606",
"license": "mit",
"hash": 8558737351627373000,
"line_mean": 34.0375,
"line_max": 93,
"alpha_frac": 0.6264716375,
"autogenerated": false,
"ratio": 3.8214042263122017,
"config_test": true,
"has_no_keyword... |
from django.test import TestCase
from django.shortcuts import reverse
from model_mommy import mommy
from ringapp.models import *
class EndpointTestCase(TestCase):
def test_gets(self):
rp = mommy.make(RingProperty)
p = Property.objects.get(name='commutative')
rp.property = p
rp.sa... | {
"repo_name": "rschwiebert/RingApp",
"path": "ringapp/tests/test_endpoints.py",
"copies": "1",
"size": "2139",
"license": "mit",
"hash": 7650447276955312000,
"line_mean": 39.358490566,
"line_max": 99,
"alpha_frac": 0.5783076204,
"autogenerated": false,
"ratio": 3.7925531914893615,
"config_test"... |
from django.test import TestCase
from django_superform.widgets import TemplateWidget
class TemplateWidgetTests(TestCase):
def test_it_takes_template_name_argument(self):
widget = TemplateWidget(template_name='foo.html')
self.assertEqual(widget.template_name, 'foo.html')
def test_it_puts_hidde... | {
"repo_name": "gregmuellegger/django-superform",
"path": "tests/test_widgets.py",
"copies": "1",
"size": "2149",
"license": "bsd-3-clause",
"hash": 8165673814888653000,
"line_mean": 37.375,
"line_max": 77,
"alpha_frac": 0.6477431363,
"autogenerated": false,
"ratio": 4.255445544554456,
"config_t... |
from django.test import TestCase
from django.template.defaultfilters import slugify
from django.core.exceptions import ValidationError
from django.db import IntegrityError
from competition.exceptions import TeamException
from competition.tests.utils import FancyTestCase
from competition.models.team_model import Team
f... | {
"repo_name": "michaelwisely/django-competition",
"path": "src/competition/tests/team_tests/team_model_tests.py",
"copies": "1",
"size": "3977",
"license": "bsd-3-clause",
"hash": -6288841106388506000,
"line_mean": 42.2282608696,
"line_max": 78,
"alpha_frac": 0.6165451345,
"autogenerated": false,
... |
from django.test import TestCase
from django.template.defaultfilters import slugify
from django.core.exceptions import ValidationError
from django.db import IntegrityError
from competition.tests.factories import (CompetitionFactory,
RegistrationFactory,
... | {
"repo_name": "michaelwisely/django-competition",
"path": "src/competition/tests/competition_tests/competition_model_tests.py",
"copies": "1",
"size": "5355",
"license": "bsd-3-clause",
"hash": 4893109190886500000,
"line_mean": 36.1875,
"line_max": 72,
"alpha_frac": 0.6444444444,
"autogenerated": f... |
from django.test import TestCase
from django.template.defaultfilters import slugify
from django.core.files.base import ContentFile
from django.core.files import File
from django.conf import settings
import datetime, os, shutil
from modelmanager.models import ContentModel, ModelVersion, add_target_to_anchors
class Cont... | {
"repo_name": "usgin/modelmanager",
"path": "tests/contentmodel.py",
"copies": "1",
"size": "11955",
"license": "bsd-3-clause",
"hash": 3781494541924089300,
"line_mean": 52.1377777778,
"line_max": 257,
"alpha_frac": 0.635215391,
"autogenerated": false,
"ratio": 3.9403427818061965,
"config_test"... |
from django.test import TestCase
from django.template import Context, Template
from django.template.loader import get_template
from taggit_templatetags.tests.models import AlphaModel, BetaModel
from taggit.tests.tests import BaseTaggingTest
from taggit_templatetags.templatetags.taggit_extras import get_weight_fun
cl... | {
"repo_name": "Venturi/oldcms",
"path": "env/lib/python2.7/site-packages/taggit_templatetags/tests/tests.py",
"copies": "1",
"size": "6309",
"license": "apache-2.0",
"hash": -3642010065597574000,
"line_mean": 38.9367088608,
"line_max": 102,
"alpha_frac": 0.5725154541,
"autogenerated": false,
"rat... |
from django.test import TestCase
from django.template import Context, Template
from django.template.response import SimpleTemplateResponse
from ostinato.pages.models import Page
from ostinato.pages.templatetags.pages_tags import (
get_page,
filter_pages,
breadcrumbs,
)
from .utils import *
class NavBarT... | {
"repo_name": "andrewebdev/django-ostinato",
"path": "ostinato/tests/pages/tests/test_templatetags.py",
"copies": "1",
"size": "4833",
"license": "mit",
"hash": -1849245374101895400,
"line_mean": 30.3831168831,
"line_max": 105,
"alpha_frac": 0.5839023381,
"autogenerated": false,
"ratio": 3.609410... |
from django.test import TestCase
from django.template import Context, Template
class urltagsTest(TestCase):
"""
Tests for django-urltags
"""
def test_add_fragment(self):
tmpl = Template("{% load url_tags %}{{ url|add_fragment:'frgment' }}")
ctxt = Context({'url': 'http://example.com/in... | {
"repo_name": "callowayproject/django-urltags",
"path": "urltags/tests.py",
"copies": "1",
"size": "2321",
"license": "apache-2.0",
"hash": 1796961580743632000,
"line_mean": 45.42,
"line_max": 91,
"alpha_frac": 0.6006031883,
"autogenerated": false,
"ratio": 3.565284178187404,
"config_test": tru... |
from django.test import TestCase
from django.template import loader, base, Context
import oscar
class TestOscarCoreAppsList(TestCase):
def test_includes_oscar_itself(self):
core_apps = oscar.OSCAR_CORE_APPS
self.assertTrue('oscar' in core_apps)
def test_can_be_retrieved_through_fn(self):
... | {
"repo_name": "QLGu/django-oscar",
"path": "tests/unit/settings_tests.py",
"copies": "30",
"size": "1692",
"license": "bsd-3-clause",
"hash": 9092660322925862000,
"line_mean": 33.5306122449,
"line_max": 66,
"alpha_frac": 0.6572104019,
"autogenerated": false,
"ratio": 3.6862745098039214,
"config... |
from django.test import TestCase
from django.template import loader, TemplateDoesNotExist
import oscar
class TestOscarCoreAppsList(TestCase):
def test_includes_oscar_itself(self):
core_apps = oscar.OSCAR_CORE_APPS
self.assertTrue('oscar' in core_apps)
def test_can_be_retrieved_through_fn(se... | {
"repo_name": "anandsimmy/ecommerce",
"path": "tests/integration/test_settings.py",
"copies": "3",
"size": "1680",
"license": "bsd-3-clause",
"hash": 1941127519228544000,
"line_mean": 33.2857142857,
"line_max": 66,
"alpha_frac": 0.656547619,
"autogenerated": false,
"ratio": 3.7333333333333334,
... |
from django.test import TestCase
from django.template import Template, Context
from django.contrib.contenttypes.models import ContentType
from django.template.loader import render_to_string
from .factories import TaggedItemFactory, TagTestArticle0Factory
class TaggingTemplateTagTestCase(TestCase):
def test_get_ta... | {
"repo_name": "giginet/django-generic-tagging",
"path": "generic_tagging/tests/test_templatetags.py",
"copies": "1",
"size": "2653",
"license": "mit",
"hash": -6519991170672320000,
"line_mean": 36.9,
"line_max": 100,
"alpha_frac": 0.6110064078,
"autogenerated": false,
"ratio": 4.031914893617022,
... |
from django.test import TestCase
from django.template import Template, Context
from django.http import HttpRequest
from simple_pagination.utils import(
normalize_page_number,
get_querystring_for_page,
get_page_numbers,
)
from simple_pagination.models import EndlessPage, PageList, ShowItems
from django.http ... | {
"repo_name": "MicroPyramid/django-simple-pagination",
"path": "simple_pagination/tests.py",
"copies": "2",
"size": "3423",
"license": "mit",
"hash": -7379123336854223000,
"line_mean": 33.9285714286,
"line_max": 122,
"alpha_frac": 0.5848670757,
"autogenerated": false,
"ratio": 4.017605633802817,
... |
from django.test import TestCase
from django.template import Template, Context
from django_inlines import inlines
from django_inlines.samples import YoutubeInline
from django_inlines.templatetags.inlines import stripinlines
from test_inlines import QuineInline, DoubleInline
class StripInlinesTestCase(TestCase):
d... | {
"repo_name": "artscoop/django_inlines",
"path": "tests/core/tests/templatetags.py",
"copies": "2",
"size": "8390",
"license": "bsd-3-clause",
"hash": -585676728067514500,
"line_mean": 55.6891891892,
"line_max": 566,
"alpha_frac": 0.6402860548,
"autogenerated": false,
"ratio": 3.4669421487603307,... |
from django.test import TestCase
from django.template import Template, Context
from django.utils.html import escape
from richtemplates.templatetags.breadcrumber import SEPARATOR
def render(template, context={}):
"""
Returns rendered ``template`` with ``context``, which are given as string
and dict respect... | {
"repo_name": "lukaszb/django-richtemplates",
"path": "richtemplates/tests/test_breadcrumber.py",
"copies": "1",
"size": "1707",
"license": "bsd-3-clause",
"hash": 3432606347790070300,
"line_mean": 30.6111111111,
"line_max": 79,
"alpha_frac": 0.5653192736,
"autogenerated": false,
"ratio": 3.78492... |
from django.test import TestCase
from django.template import Template, Context
from django.contrib.auth.models import User
from rottweiler import registry
from .stubs import ModelStub
def positive_permission(self, user):
return True
def negative_permission(self, user):
return False
class TestRottwei... | {
"repo_name": "TwigWorld/django-rottweiler",
"path": "rottweiler/tests/test_rottweiler_tags.py",
"copies": "1",
"size": "2375",
"license": "mit",
"hash": 7591064785426575000,
"line_mean": 32.4507042254,
"line_max": 75,
"alpha_frac": 0.5848421053,
"autogenerated": false,
"ratio": 4.611650485436893... |
from django.test import TestCase
from django.template import Template, Context
from .models import DummyModel
class ValueListTest(TestCase):
def test_empty_list_should_show_none(self):
out = Template(
'{% load mapentity_tags %}'
'{% valuelist items %}'
).render(Context({
... | {
"repo_name": "Anaethelion/django-mapentity",
"path": "mapentity/tests/test_templatetags.py",
"copies": "1",
"size": "1674",
"license": "bsd-3-clause",
"hash": -2144879615374035700,
"line_mean": 35.3913043478,
"line_max": 89,
"alpha_frac": 0.5376344086,
"autogenerated": false,
"ratio": 3.875,
"... |
from django.test import TestCase
from django.template import Template, Context
from projector.settings import get_config_value
def render(template, context):
"""
Returns rendered ``template`` with ``context``, which are given as string
and dict respectively.
"""
t = Template(template)
return t... | {
"repo_name": "lukaszb/django-projector",
"path": "projector/tests/test_templatetags.py",
"copies": "1",
"size": "2234",
"license": "bsd-3-clause",
"hash": -4727428083657934000,
"line_mean": 28.3947368421,
"line_max": 78,
"alpha_frac": 0.5367054611,
"autogenerated": false,
"ratio": 3.891986062717... |
from django.test import TestCase
from django.template import Template, Context, TemplateSyntaxError
from django.contrib.auth.models import AnonymousUser
from mock import patch
from waliki.models import ACLRule
from waliki.acl import check_perms
from .factories import UserFactory, GroupFactory, ACLRuleFactory
class Te... | {
"repo_name": "fpytloun/waliki",
"path": "tests/test_acl.py",
"copies": "8",
"size": "8859",
"license": "bsd-3-clause",
"hash": -5348281536408726000,
"line_mean": 42.8564356436,
"line_max": 98,
"alpha_frac": 0.6034541145,
"autogenerated": false,
"ratio": 3.8334054521852012,
"config_test": true,... |
from django.test import TestCase
from django.template import Template
from django.template.context import Context
from django.core.urlresolvers import NoReverseMatch
class ReversetagTest(TestCase):
def test_base(self):
t1 = Template("""{% load reversetag %}{% reverse "URL1" %}""")
self.ass... | {
"repo_name": "ulope/django-reversetag",
"path": "tests/revtest/tests.py",
"copies": "1",
"size": "2521",
"license": "mit",
"hash": 8337398849210786000,
"line_mean": 50.4693877551,
"line_max": 222,
"alpha_frac": 0.5874652916,
"autogenerated": false,
"ratio": 3.261319534282018,
"config_test": tr... |
from django.test import TestCase
from django.template import Template, RequestContext
from django.test.client import RequestFactory
from django.test.utils import setup_test_environment
setup_test_environment()
class CommonTestCase(TestCase):
def assertAllFine(self):
return True
class LibraryTest(CommonTestC... | {
"repo_name": "emilbjorklund/django-template-shortcodes",
"path": "tests/test_templatetags.py",
"copies": "1",
"size": "6212",
"license": "mit",
"hash": -8643339680754010000,
"line_mean": 49.9180327869,
"line_max": 213,
"alpha_frac": 0.6142949131,
"autogenerated": false,
"ratio": 3.34698275862068... |
from django.test import TestCase
from django.test.client import Client
from college.models import College, Coach, CoachForm, CoachingJob, CollegeCoach, Position, State, Game, Conference, Player, StateForm, CollegeYear, GameOffense, GameDefense, Week, City, DriveOutcome, GameDrive, PlayerRush, PlayerPass, PlayerReceivin... | {
"repo_name": "gcaprio/cfbreference_com",
"path": "college/tests.py",
"copies": "2",
"size": "3067",
"license": "apache-2.0",
"hash": -1245501533155705600,
"line_mean": 53.7678571429,
"line_max": 382,
"alpha_frac": 0.6977502445,
"autogenerated": false,
"ratio": 3.1073961499493414,
"config_test"... |
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from college.models import Student, Teacher
# Create your tests here.
class LoginTest(TestCase):
def setUp(self):
user_s = User.objects.create_user(username='studenttest', password='pkp')
student = ... | {
"repo_name": "pramodhkp/pes",
"path": "college/tests.py",
"copies": "1",
"size": "1501",
"license": "mit",
"hash": -682081618704332000,
"line_mean": 40.6944444444,
"line_max": 121,
"alpha_frac": 0.708194537,
"autogenerated": false,
"ratio": 2.9605522682445757,
"config_test": true,
"has_no_ke... |
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from django.contrib.messages import constants, set_level
from async_messages import message_user, message_users, messages
class MiddlewareTests(TestCase):
def setUp(self):
username, passwor... | {
"repo_name": "codeinthehole/django-async-messages",
"path": "tests/tests.py",
"copies": "1",
"size": "2938",
"license": "mit",
"hash": -1647083857272692500,
"line_mean": 34.3975903614,
"line_max": 89,
"alpha_frac": 0.6453369639,
"autogenerated": false,
"ratio": 3.9649122807017543,
"config_test... |
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from dbe.forum.models import *
class SimpleTest(TestCase):
def setUp(self):
f = Forum.objects.create(title="cal")
u = User.objects.create_... | {
"repo_name": "vadosl/calendar_app",
"path": "archive/cal/tests.py",
"copies": "1",
"size": "1827",
"license": "mit",
"hash": -7738504116025974000,
"line_mean": 40.5227272727,
"line_max": 81,
"alpha_frac": 0.6070060208,
"autogenerated": false,
"ratio": 3.358455882352941,
"config_test": true,
... |
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from .models import *
class SimpleTest(TestCase):
def setUp(self):
f = Forum.objects.create(title="forum")
u = User.objects.create_user("a... | {
"repo_name": "vadosl/forum",
"path": "forum/apps/forum/tests.py",
"copies": "1",
"size": "1615",
"license": "mit",
"hash": 2587621060114839600,
"line_mean": 42.6486486486,
"line_max": 100,
"alpha_frac": 0.5950464396,
"autogenerated": false,
"ratio": 3.4,
"config_test": true,
"has_no_keywords... |
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from userlog import models as m
from userlog.tests.utils import is_recent
from datetime import datetime, timedelta
class LoginIsLoggedTest(TestCase):
def setUp(self):
user = User.objects.cr... | {
"repo_name": "muccg/django-userlog",
"path": "userlog/tests/test_login_is_logged.py",
"copies": "1",
"size": "1629",
"license": "bsd-3-clause",
"hash": -2034051310864109300,
"line_mean": 36.8837209302,
"line_max": 83,
"alpha_frac": 0.5880908533,
"autogenerated": false,
"ratio": 3.458598726114649... |
from django.test import TestCase
from django.test.client import Client
from django.contrib.flatpages.models import FlatPage
from django.contrib.auth.models import User, Group
from django.contrib.contenttypes.models import ContentType
# Test against flat pages
import objectpermissions
from models import ModelPermission... | {
"repo_name": "callowayproject/django-objectpermissions",
"path": "objectpermissions/tests.py",
"copies": "1",
"size": "8410",
"license": "apache-2.0",
"hash": 3323785125424739300,
"line_mean": 40.0243902439,
"line_max": 122,
"alpha_frac": 0.6105826397,
"autogenerated": false,
"ratio": 3.46804123... |
from django.test import TestCase
from django.test.client import Client
from django.core import mail
from django.conf import settings
from django.core.urlresolvers import reverse
from vwcourses.courses.models import Course
class ContactCourseTestCase(TestCase):
def setUp(self):
self.course = Course.objects.creat... | {
"repo_name": "VWApplications/VWCourses",
"path": "vwcourses/courses/tests/test_emails.py",
"copies": "1",
"size": "1260",
"license": "mpl-2.0",
"hash": 7142980633027346000,
"line_mean": 39.5806451613,
"line_max": 99,
"alpha_frac": 0.7082670906,
"autogenerated": false,
"ratio": 3.456043956043956,... |
from django.test import TestCase
from django.test.client import Client
from django.core.management import call_command
from create_dataset.utils import CreateDataset
from public_interface.models import Genes
class CreateTNTDatasetTest(TestCase):
def setUp(self):
args = []
opts = {'dumpfile': 'tes... | {
"repo_name": "carlosp420/VoSeq",
"path": "voseq/create_dataset/tests/tests_create_tnt_dataset.py",
"copies": "1",
"size": "4617",
"license": "bsd-3-clause",
"hash": 7772957376516856000,
"line_mean": 38.4615384615,
"line_max": 112,
"alpha_frac": 0.6159844055,
"autogenerated": false,
"ratio": 3.67... |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse_lazy, reverse
from ..models import Quota, User
from .. import cluster_id
class ViewsTests(TestCase):
def setUp(self):
self.client = Client()
self.user = User.objects.create_user(user... | {
"repo_name": "vecnet/vnetsource",
"path": "job_services/tests/views_tests.py",
"copies": "2",
"size": "4025",
"license": "mpl-2.0",
"hash": -2274125916008324900,
"line_mean": 44.75,
"line_max": 118,
"alpha_frac": 0.6467080745,
"autogenerated": false,
"ratio": 3.60663082437276,
"config_test": t... |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from datetime import datetime, timedelta
from random import randint
from shoppleyuser.models import *
import json
from mailer.models import Message
class SimpleTest(TestCase):
fixtures = ['']
def r... | {
"repo_name": "kwantopia/shoppley-migrate",
"path": "shoppley.com/shoppley/apps/shoppleyuser/tests.py",
"copies": "1",
"size": "2761",
"license": "mit",
"hash": -7010122852234253000,
"line_mean": 33.9493670886,
"line_max": 184,
"alpha_frac": 0.7059036581,
"autogenerated": false,
"ratio": 3.044101... |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.conf import settings
import base64, json
class FHIR_CheckUnAuthInteraction_TestCase(TestCase):
"""
Test FHIR for Unauthorized Interaction
"""
#auth_headers = {"HTTP... | {
"repo_name": "ekivemark/BlueButtonFHIR_API",
"path": "fhir/tests/test_resource_and_interaction_support.py",
"copies": "2",
"size": "2317",
"license": "apache-2.0",
"hash": 1097008269817778700,
"line_mean": 32.5942028986,
"line_max": 84,
"alpha_frac": 0.6206301252,
"autogenerated": false,
"ratio"... |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.contrib.auth.backends import ModelBackend
from django.conf import settings
from ummeli.vlive.tests.utils import VLiveClient, VLiveTestCase
import ur... | {
"repo_name": "praekelt/ummeli",
"path": "ummeli/vlive/tests/ummeli_zero_authentication.py",
"copies": "1",
"size": "5637",
"license": "bsd-3-clause",
"hash": -1778923026366454800,
"line_mean": 33.5828220859,
"line_max": 90,
"alpha_frac": 0.6130920703,
"autogenerated": false,
"ratio": 3.986562942... |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.contrib.auth import logout as django_logout
from django.contrib.auth import login as django_login
from django.contrib.auth import authenticate as dj... | {
"repo_name": "geonition/softgis-api",
"path": "softgis_feature/tests.py",
"copies": "1",
"size": "35397",
"license": "mit",
"hash": 8009853748868199000,
"line_mean": 43.8631178707,
"line_max": 316,
"alpha_frac": 0.4733451987,
"autogenerated": false,
"ratio": 5.039436218678816,
"config_test": t... |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django_vcs_watch.models import Repository
from django_vcs_watch.utils import make_slug, DiffProcessor, mongo
from django_vcs_watch.settings import VCS_ONL... | {
"repo_name": "svetlyak40wt/django-vcs-watch",
"path": "src/django_vcs_watch/tests.py",
"copies": "1",
"size": "9867",
"license": "bsd-3-clause",
"hash": -8695825031297850000,
"line_mean": 39.4385245902,
"line_max": 114,
"alpha_frac": 0.5737306172,
"autogenerated": false,
"ratio": 4.0554870530209... |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from .user_forms import LoginForm
class RoutingTestCase(TestCase):
def setUp(self):
self.client = Client()
self.user = User.objects.creat... | {
"repo_name": "hizni/vod-systems",
"path": "vod_systems/vod/tests.py",
"copies": "1",
"size": "1599",
"license": "mit",
"hash": -4640345307001931000,
"line_mean": 38,
"line_max": 93,
"alpha_frac": 0.6772983114,
"autogenerated": false,
"ratio": 3.9095354523227384,
"config_test": true,
"has_no_... |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.utils import simplejson as json
from ..examiner import RestfulSimplifiedSubject, RestfulSimplifiedPeriod, RestfulSimplifiedAssignment
class TestRestfulSimplifiedSubjectNoFixture(TestCase):... | {
"repo_name": "vegarang/devilry-django",
"path": "devilry/apps/examiner/tests/restful.py",
"copies": "1",
"size": "3907",
"license": "bsd-3-clause",
"hash": -8934879019759628000,
"line_mean": 36.5673076923,
"line_max": 101,
"alpha_frac": 0.6147939596,
"autogenerated": false,
"ratio": 3.6243042671... |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from pendulum.tests.utils import VALID_PASSWORD, VALID_USER, ffd
from pendulum.models import Entry
from datetime import datetime, timedelta
class AddEntryTestCase(TestCase):
"""
Rules for adding ... | {
"repo_name": "codekoala/django-pendulum",
"path": "pendulum/tests/add.py",
"copies": "1",
"size": "8057",
"license": "mit",
"hash": 764552728728051600,
"line_mean": 41.1832460733,
"line_max": 88,
"alpha_frac": 0.5004344049,
"autogenerated": false,
"ratio": 4.900851581508515,
"config_test": tru... |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from unittest2 import skipIf
from myuw.test.api import missing_url, get_user, get_user_pass
from django.test.utils import override_settings
import json
FDAO_SWS = 'restclients.dao_implementation.sws.Fil... | {
"repo_name": "fanglinfang/myuw",
"path": "myuw/test/api/future_schedule.py",
"copies": "1",
"size": "4207",
"license": "apache-2.0",
"hash": -2849150033845678000,
"line_mean": 39.8446601942,
"line_max": 66,
"alpha_frac": 0.5761825529,
"autogenerated": false,
"ratio": 4.26241134751773,
"config_... |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from speaker.models import Speaker
from .models import Presentation, Category
class PresentationTestMixin(object):
def setUp(self):
self.speaker = Speaker.objects.create(
first_... | {
"repo_name": "bahattincinic/django-101",
"path": "presentation/tests.py",
"copies": "1",
"size": "2664",
"license": "mit",
"hash": -4539017554546281000,
"line_mean": 39.3636363636,
"line_max": 78,
"alpha_frac": 0.6951951952,
"autogenerated": false,
"ratio": 4.123839009287925,
"config_test": tr... |
from django.test import TestCase
from django.test.client import Client
from django.test.utils import override_settings
from . import models, utils, views
class BaseModelTest(TestCase):
def setUp(self):
self.c = Client()
self.instance = self.model.objects.create()
self.url = self.instance.... | {
"repo_name": "saulshanabrook/django-dumper",
"path": "test/test_full_stack.py",
"copies": "1",
"size": "6581",
"license": "mit",
"hash": -5987680918629244000,
"line_mean": 31.905,
"line_max": 78,
"alpha_frac": 0.6312110621,
"autogenerated": false,
"ratio": 4.234877734877735,
"config_test": tru... |
from django.test import TestCase
from django.test.client import Client
from django.urls import reverse
from model_mommy import mommy
from mail.models import MailTemplate
from users.models import Lageruser
class TestMailTemplate(TestCase):
def setUp(self):
self.client = Client()
Lageruser.objects... | {
"repo_name": "MPIB/Lagerregal",
"path": "mail/tests.py",
"copies": "1",
"size": "1627",
"license": "bsd-3-clause",
"hash": 8698708844762580000,
"line_mean": 35.9772727273,
"line_max": 105,
"alpha_frac": 0.6748617087,
"autogenerated": false,
"ratio": 3.748847926267281,
"config_test": true,
"h... |
from django.test import TestCase
from django.test.client import Client
from django.urls import reverse
from model_mommy import mommy
from network.models import IpAddress
from users.models import Lageruser
class IpAddressTests(TestCase):
def setUp(self):
self.client = Client()
self.admin = Lageru... | {
"repo_name": "MPIB/Lagerregal",
"path": "network/tests.py",
"copies": "1",
"size": "2252",
"license": "bsd-3-clause",
"hash": 9109804816632756000,
"line_mean": 37.8275862069,
"line_max": 108,
"alpha_frac": 0.6789520426,
"autogenerated": false,
"ratio": 3.8694158075601375,
"config_test": true,
... |
from django.test import TestCase
from django.test.client import Client
from django.utils import simplejson as json
from maps.models import User, UserProfile, Item
from settings import *
class ItemTest(TestCase):
def setUp(self):
self.client = Client()
peter = User.objects.create(username="peter")... | {
"repo_name": "originalpete/reyooz",
"path": "maps/tests.py",
"copies": "1",
"size": "1574",
"license": "bsd-3-clause",
"hash": -6553065418254561000,
"line_mean": 37.3902439024,
"line_max": 91,
"alpha_frac": 0.6003811944,
"autogenerated": false,
"ratio": 3.5291479820627805,
"config_test": true,... |
from django.test import TestCase
from django.test.client import Client
from django.utils.six import StringIO
from django_facebook.utils import get_user_model, is_user_attribute
from mock import patch
class FacebookTest(TestCase):
'''
Normal Facebook tests run against a fake API
'''
def setUp(self):... | {
"repo_name": "VishvajitP/Django-facebook",
"path": "django_facebook/test_utils/testcases.py",
"copies": "25",
"size": "3230",
"license": "bsd-3-clause",
"hash": 8866464359510347000,
"line_mean": 32.6458333333,
"line_max": 108,
"alpha_frac": 0.6492260062,
"autogenerated": false,
"ratio": 4.358974... |
from django.test import TestCase
from django.test.client import Client
from domain.models import Domain
from django.contrib.auth.models import User
from hq.tests.util import create_user_and_domain
from receiver.tests.util import *
class ViewsTestCase(TestCase):
def setUp(self):
create_user_and_domain(... | {
"repo_name": "commtrack/commtrack-core",
"path": "apps/receiver/tests/views.py",
"copies": "3",
"size": "2804",
"license": "bsd-3-clause",
"hash": 4417325625504972000,
"line_mean": 42.8125,
"line_max": 84,
"alpha_frac": 0.6726105563,
"autogenerated": false,
"ratio": 4.22289156626506,
"config_t... |
from django.test import TestCase
from django.test.client import Client
from domain.models import Domain
from django.contrib.auth.models import User
from hq.tests.util import create_user_and_domain
class ViewsTestCase(TestCase):
def setUp(self):
create_user_and_domain()
self.client.login(userna... | {
"repo_name": "commtrack/commtrack-core",
"path": "apps/reports/tests/views.py",
"copies": "3",
"size": "1869",
"license": "bsd-3-clause",
"hash": -7820093601975305000,
"line_mean": 37.9375,
"line_max": 86,
"alpha_frac": 0.6452648475,
"autogenerated": false,
"ratio": 4.071895424836601,
"config_... |
from django.test import TestCase
from django.test.client import Client
from hq.models import ExtUser, Domain
from hq.tests.util import create_user_and_domain
class ViewsTestCase(TestCase):
def setUp(self):
create_user_and_domain()
self.client.login(username='brian',password='test')
def te... | {
"repo_name": "commtrack/commtrack-old-to-del",
"path": "apps/reports/tests/views.py",
"copies": "1",
"size": "1833",
"license": "bsd-3-clause",
"hash": -7351757317672028000,
"line_mean": 38,
"line_max": 86,
"alpha_frac": 0.641025641,
"autogenerated": false,
"ratio": 4.046357615894039,
"config_... |
from django.test import TestCase
from django.test.client import Client
from hq.tests.util import create_user_and_domain
from hq.models import ExtUser, Domain
from graphing.models import *
class ViewsTestCase(TestCase):
def setUp(self):
create_user_and_domain()
self.client.login(username='brian... | {
"repo_name": "commtrack/commtrack-old-to-del",
"path": "apps/graphing/tests/views.py",
"copies": "1",
"size": "2039",
"license": "bsd-3-clause",
"hash": 1357789397163198000,
"line_mean": 37.4716981132,
"line_max": 70,
"alpha_frac": 0.6463952918,
"autogenerated": false,
"ratio": 4.144308943089431... |
from django.test import TestCase
from django.test.client import Client
from main.models import Authors,Posts,Friends
from main.views import getGithubActivity
class ProjectTestCase(TestCase):
"""
This file tests socialmedia's models and views, these are what
makes the bulk of our project
"""
def set... | {
"repo_name": "TeamUACS1/410Project",
"path": "tests/testProject.py",
"copies": "1",
"size": "2169",
"license": "apache-2.0",
"hash": -1176750792587163400,
"line_mean": 39.9245283019,
"line_max": 108,
"alpha_frac": 0.7067773167,
"autogenerated": false,
"ratio": 3.5097087378640777,
"config_test"... |
from django.test import TestCase
from django.test.client import Client
from mock import patch
from regcore_read.views.es_search import transform_results
class ViewsESSearchTest(TestCase):
urls = 'regcore_read.tests.urls'
def test_search_missing_q(self):
response = Client().get('/es_search?non_q=test'... | {
"repo_name": "cmc333333/regulations-core",
"path": "regcore_read/tests/views_es_search_tests.py",
"copies": "1",
"size": "4256",
"license": "cc0-1.0",
"hash": -5658813105259633000,
"line_mean": 46.2888888889,
"line_max": 79,
"alpha_frac": 0.5472274436,
"autogenerated": false,
"ratio": 3.63139931... |
from django.test import TestCase
from django.test.client import Client
from mock import patch
from regcore_read.views.es_search import *
class ViewsESSearchTest(TestCase):
urls = 'regcore_read.tests.urls'
def test_search_missing_q(self):
response = Client().get('/es_search?non_q=test')
self.... | {
"repo_name": "adderall/regulations-core",
"path": "regcore_read/tests/views_es_search_tests.py",
"copies": "6",
"size": "4244",
"license": "cc0-1.0",
"hash": -6845159853243718000,
"line_mean": 45.6373626374,
"line_max": 79,
"alpha_frac": 0.5454759661,
"autogenerated": false,
"ratio": 3.614991482... |
from django.test import TestCase
from django.test.client import Client
from uriredirect.views import resolve_uri
class ResolverTestCase(TestCase):
fixtures = [ 'test_uriregister.json', 'test_rewriterule.json', 'test_mediatype.json', 'test_acceptmapping.json' ]
def setUp(self):
self.c = Client()
... | {
"repo_name": "usgin/uriredirect",
"path": "tests/ResolverTestCase.py",
"copies": "1",
"size": "5233",
"license": "bsd-3-clause",
"hash": 3449392385786252000,
"line_mean": 69.7297297297,
"line_max": 197,
"alpha_frac": 0.7022740302,
"autogenerated": false,
"ratio": 3.833699633699634,
"config_tes... |
from django.test import TestCase
from django.test.client import Client
from wagtail.wagtailredirects import models
from wagtail.tests.utils import WagtailTestUtils
from django.core.urlresolvers import reverse
class TestRedirects(TestCase):
def test_path_normalisation(self):
# Shortcut to normalise functio... | {
"repo_name": "taedori81/wagtail",
"path": "wagtail/wagtailredirects/tests.py",
"copies": "6",
"size": "8401",
"license": "bsd-3-clause",
"hash": 4281332056908018000,
"line_mean": 38.0744186047,
"line_max": 146,
"alpha_frac": 0.6457564576,
"autogenerated": false,
"ratio": 3.912901723334886,
"co... |
from django.test import TestCase
from django.test.client import Client
from xformmanager.tests.util import create_xsd_and_populate, populate
from xformmanager.manager import XFormManager
from hq.models import ExtUser, Domain
from hq.tests.util import create_user_and_domain
class ViewsTestCase(TestCase):
def s... | {
"repo_name": "commtrack/commtrack-old-to-del",
"path": "apps/xformmanager/tests/views.py",
"copies": "1",
"size": "4432",
"license": "bsd-3-clause",
"hash": 1787248996445108500,
"line_mean": 41.6153846154,
"line_max": 105,
"alpha_frac": 0.6342509025,
"autogenerated": false,
"ratio": 3.8505647263... |
from django.test import TestCase
from django.test.client import Client
import json
from contextlib import nested
import mock
import webmpris
class PlayersTestCase(TestCase):
def setUp(self):
self.client = Client()
def test_players(self):
ids = [':1.235', '1:4589']
with mock.patch('py... | {
"repo_name": "wistful/webmpris",
"path": "webmpris/tests.py",
"copies": "1",
"size": "7271",
"license": "mit",
"hash": 8855292573377480000,
"line_mean": 32.05,
"line_max": 76,
"alpha_frac": 0.5264750378,
"autogenerated": false,
"ratio": 3.9154550350026924,
"config_test": true,
"has_no_keywor... |
from django.test import TestCase
from django.test.client import Client
import json
from django.contrib.auth.models import User
from web_fe.views import *
def userSetup(current_test):
# First create a new user
current_test.test_user = User.objects.create_user(
'testuser', 'test@test.test', 'testpass')
... | {
"repo_name": "chaosphere2112/acme-web-fe",
"path": "apps/web_fe/tests.py",
"copies": "1",
"size": "11963",
"license": "apache-2.0",
"hash": 3271389419339886000,
"line_mean": 32.1385041551,
"line_max": 138,
"alpha_frac": 0.592827886,
"autogenerated": false,
"ratio": 3.9730986383261375,
"config_... |
from django.test import TestCase
from django.test.client import Client
class ViewTest(TestCase):
fixtures = ['test_data.json']
def setUp(self):
self.client = Client()
def test_register_page(self):
data = {
'username': 'test_user',
'email': 'test_user@example.co... | {
"repo_name": "underlost/GamerNews",
"path": "gamernews/apps/news/tests.py",
"copies": "1",
"size": "1226",
"license": "mit",
"hash": 4768400044332818000,
"line_mean": 29.65,
"line_max": 60,
"alpha_frac": 0.5432300163,
"autogenerated": false,
"ratio": 4.114093959731544,
"config_test": true,
"... |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
class SimpleTest(TestCase):
def setUp(self):
self.client = Client()
def test_basic(self):
""" Basic testing for the RST -> HTML conversion using Sphinx."""
response = se... | {
"repo_name": "Srisai85/SciPyCentral",
"path": "scipy_central/rest_comments/tests.py",
"copies": "1",
"size": "4052",
"license": "bsd-3-clause",
"hash": -7004039306410527000,
"line_mean": 50.3037974684,
"line_max": 96,
"alpha_frac": 0.4471865745,
"autogenerated": false,
"ratio": 4.404347826086957... |
from django.test import TestCase
from django.test.client import Client
from ophrys.core.config import config, ConfigVariable
from ophrys.core.models import ConfigStore
from ophrys.core.signals import get_config_groups
class ConfigTest(TestCase):
def test_get_config_var_default_value(self):
self.assertEqu... | {
"repo_name": "Ophrys-Project/Ophrys",
"path": "tests/core/test_config.py",
"copies": "1",
"size": "4667",
"license": "mit",
"hash": 4455892674035338000,
"line_mean": 46.6224489796,
"line_max": 112,
"alpha_frac": 0.7122348404,
"autogenerated": false,
"ratio": 3.1030585106382977,
"config_test": ... |
from django.test import TestCase
from django.test.client import Client
from teams.models import Team
from projects.models import Project, ProjectMembership
from buildbuild import attributes_for_tests
class TestAPITeamUserListSearch(TestCase):
fixtures = ['properties_data.yaml']
"""
* Test Scenario
... | {
"repo_name": "buildbuild/buildbuild",
"path": "buildbuild/api/tests/test_api_teamproject_list_search.py",
"copies": "1",
"size": "3244",
"license": "bsd-3-clause",
"hash": -2204847448311427000,
"line_mean": 39.55,
"line_max": 119,
"alpha_frac": 0.663378545,
"autogenerated": false,
"ratio": 3.848... |
from django.test import TestCase
from django.test.client import Client
from users.models import User
from buildbuild import custom_msg
class LoginPageTest(TestCase):
def setUp(self):
self.client = Client()
self.user_email = "test@example.com"
self.user_password = "test_password"
se... | {
"repo_name": "buildbuild/buildbuild",
"path": "buildbuild/users/tests/test_login_page.py",
"copies": "1",
"size": "2581",
"license": "bsd-3-clause",
"hash": 5322114978433182000,
"line_mean": 39.9682539683,
"line_max": 93,
"alpha_frac": 0.6454862456,
"autogenerated": false,
"ratio": 3.91060606060... |
from django.test import TestCase
from django.test.client import Client
from users.models import User
from users.views import SignUp
from django.core import mail
from django.conf import settings
from django.db.utils import OperationalError
from users import tasks
class Send_Email_Test(TestCase):
def setUp(self)... | {
"repo_name": "buildbuild/buildbuild",
"path": "buildbuild/users/tests/test_send_mail.py",
"copies": "1",
"size": "1739",
"license": "bsd-3-clause",
"hash": 3319437733164612000,
"line_mean": 28.9827586207,
"line_max": 69,
"alpha_frac": 0.5882691202,
"autogenerated": false,
"ratio": 4.111111111111... |
from django.test import TestCase
from django.test.client import Client
try:
import json
except:
from django.utils import simplejson as json
from MacroExpansion import MacroExpansion
from KeyValueTree import KeyValueTree
from truth.models import Truth, KeyValue as TruthKeyValue
class TestMacroExpansion(TestCas... | {
"repo_name": "rtucker-mozilla/mozilla_inventory",
"path": "api/tests.py",
"copies": "1",
"size": "7446",
"license": "bsd-3-clause",
"hash": 6692727624913061000,
"line_mean": 48.9731543624,
"line_max": 163,
"alpha_frac": 0.6473274241,
"autogenerated": false,
"ratio": 3.2744063324538257,
"config... |
from django.test import TestCase
from django.test.client import RequestFactory, Client
from django.db import models
from django.contrib.auth.models import User, Group
from django.core.urlresolvers import reverse
from django.conf import settings
from core import ContentBrowser, cbregistry
from views import BrowserItems... | {
"repo_name": "andrewebdev/django-contentbrowser",
"path": "src/contentbrowser/tests.py",
"copies": "1",
"size": "5360",
"license": "mit",
"hash": -7489024637510820000,
"line_mean": 26.3469387755,
"line_max": 76,
"alpha_frac": 0.7304104478,
"autogenerated": false,
"ratio": 3.377441713925646,
"c... |
from django.test import TestCase
from django.test.client import RequestFactory, Client
from chat.views import ComposeView
from user.models import HealthProfessional, Patient, AssociatedHealthProfessionalAndPatient
class TestComposeView(TestCase):
"""
Testing methods of Class ComposeView.
"""
def setU... | {
"repo_name": "fga-gpp-mds/2017.2-Receituario-Medico",
"path": "medical_prescription/chat/test/test_view_compose.py",
"copies": "1",
"size": "3010",
"license": "mit",
"hash": -368492494413628860,
"line_mean": 36.1604938272,
"line_max": 91,
"alpha_frac": 0.5332225914,
"autogenerated": false,
"rati... |
from django.test import TestCase
from django.test.client import RequestFactory, Client
from disease.models import Disease
from medicine.models import ManipulatedMedicine
from user.models import Patient, HealthProfessional
from prescription.views import CreatePrescriptionView, ListFavoritePrescription
class TestListF... | {
"repo_name": "fga-gpp-mds/2017.2-Receituario-Medico",
"path": "medical_prescription/prescription/test/test_view_favorite_prescriptions.py",
"copies": "1",
"size": "2419",
"license": "mit",
"hash": -6053678863269273000,
"line_mean": 38.6393442623,
"line_max": 100,
"alpha_frac": 0.658808933,
"autoge... |
from django.test import TestCase
from django.test.client import RequestFactory, Client
from prescription.models import Pattern
from prescription.views import CreatePatternView
from user.models import HealthProfessional
class TestCreatePattern(TestCase):
def setUp(self):
self.factory = RequestFactory()
... | {
"repo_name": "fga-gpp-mds/2017.2-Receituario-Medico",
"path": "medical_prescription/prescription/test/test_view_createpattern.py",
"copies": "1",
"size": "1606",
"license": "mit",
"hash": 6290679571452089000,
"line_mean": 29.3018867925,
"line_max": 78,
"alpha_frac": 0.599003736,
"autogenerated": f... |
from django.test import TestCase
from django.test.client import RequestFactory
from django.contrib.auth.models import AnonymousUser
from oscar.apps.basket import middleware
class TestBasketMiddleware(TestCase):
def setUp(self):
self.middleware = middleware.BasketMiddleware()
self.request = Reque... | {
"repo_name": "vicky2135/lucious",
"path": "tests/integration/basket/test_middleware.py",
"copies": "5",
"size": "1253",
"license": "bsd-3-clause",
"hash": -786564967617433600,
"line_mean": 35.8529411765,
"line_max": 93,
"alpha_frac": 0.7063048683,
"autogenerated": false,
"ratio": 4.0160256410256... |
from django.test import TestCase
from django.test.client import RequestFactory
from django.contrib.auth.models import AnonymousUser
from user.models import HealthProfessional
from prescription.models import Pattern
from prescription.views import EditPatternView
class TestEditPattern(TestCase):
def setUp(self):
... | {
"repo_name": "fga-gpp-mds/2017.2-Receituario-Medico",
"path": "medical_prescription/prescription/test/test_view_editpattern.py",
"copies": "1",
"size": "2996",
"license": "mit",
"hash": -1870761663317958000,
"line_mean": 43.7164179104,
"line_max": 120,
"alpha_frac": 0.5497329773,
"autogenerated": ... |
from django.test import TestCase
from django.test.client import RequestFactory
from django.core.cache import caches
from ostinato.pages.models import Page
from .utils import *
class PageManagerTestCase(TestCase):
def setUp(self):
create_pages()
def test_published(self):
self.assertEqual(
... | {
"repo_name": "andrewebdev/django-ostinato",
"path": "ostinato/tests/pages/tests/test_managers.py",
"copies": "1",
"size": "4389",
"license": "mit",
"hash": 4665363110917633000,
"line_mean": 29.9084507042,
"line_max": 81,
"alpha_frac": 0.5178856231,
"autogenerated": false,
"ratio": 3.508393285371... |
from django.test import TestCase
from django.test.client import RequestFactory
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User, Group
from perfiles_usuario.utils import ADMINISTRADOR_GROUP, CAPTURISTA_GROUP
from perfiles_usuario.models import Capturista
from familias.models impo... | {
"repo_name": "erikiado/jp2_online",
"path": "administracion/tests.py",
"copies": "1",
"size": "13960",
"license": "mit",
"hash": -6022883909514258000,
"line_mean": 40.0529411765,
"line_max": 98,
"alpha_frac": 0.5762286861,
"autogenerated": false,
"ratio": 3.866481994459834,
"config_test": true... |
from django.test import TestCase
from django.test.client import RequestFactory
from django.core.urlresolvers import reverse
from django.template import Template, Context
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from wagtail.tests.utils import WagtailTestUtils
... | {
"repo_name": "mephizzle/wagtail",
"path": "wagtail/wagtailadmin/tests/test_userbar.py",
"copies": "6",
"size": "4676",
"license": "bsd-3-clause",
"hash": -8934968161120234000,
"line_mean": 39.6608695652,
"line_max": 133,
"alpha_frac": 0.6817792985,
"autogenerated": false,
"ratio": 3.956006768189... |
from django.test import TestCase
from django.test.client import RequestFactory
from django.http.response import Http404
from metaphor.views import *
from metaphor.random_metaphor import RandomMetaphor
from metaphor.is_a_metaphor import IsAMetaphor
from metaphor.w2v_subs import W2VSubs
from metaphor.metaphor import Meta... | {
"repo_name": "guiem/metaphor",
"path": "metaphor/tests/tests.py",
"copies": "1",
"size": "15579",
"license": "mit",
"hash": -2639087545404829700,
"line_mean": 41.6336088154,
"line_max": 120,
"alpha_frac": 0.5804200323,
"autogenerated": false,
"ratio": 3.201282581712867,
"config_test": true,
... |
from django.test import TestCase
from django.test.client import RequestFactory
from django.template.context import RequestContext
from mock import Mock
from ..views import PleaOnlineForms
from ..models import CourtEmailCount, Court, Case
class TestMultiPleaFormBase(TestCase):
def create_court(self):
se... | {
"repo_name": "ministryofjustice/manchester_traffic_offences_pleas",
"path": "apps/plea/tests/test_sjp.py",
"copies": "1",
"size": "4848",
"license": "mit",
"hash": 293121254600447000,
"line_mean": 32.6666666667,
"line_max": 70,
"alpha_frac": 0.4880363036,
"autogenerated": false,
"ratio": 4.09459... |
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from organizations.forms import (OrganizationForm, OrganizationUserForm,
OrganizationUserAddForm)
from organizations.models import Organization
from .utils import request_factory_login... | {
"repo_name": "st8st8/django-organizations",
"path": "tests/test_forms.py",
"copies": "3",
"size": "3062",
"license": "bsd-2-clause",
"hash": 8944044561573808000,
"line_mean": 39.2894736842,
"line_max": 85,
"alpha_frac": 0.6303069889,
"autogenerated": false,
"ratio": 3.7896039603960396,
"config... |
from django.test import TestCase
from django.test.client import RequestFactory
from django.utils import simplejson as json
from django.core.files.base import ContentFile
from directupload import views
from directupload.backends import get_directupload_backend
class UploadViewsTestCase(TestCase):
#TODO this become... | {
"repo_name": "cuker/django-directupload",
"path": "directupload/tests/views.py",
"copies": "1",
"size": "2430",
"license": "bsd-3-clause",
"hash": -1095812621816954400,
"line_mean": 38.8360655738,
"line_max": 113,
"alpha_frac": 0.6592592593,
"autogenerated": false,
"ratio": 4.21875,
"config_te... |
from django.test import TestCase
from django.test.client import RequestFactory
from forms import DemoForm
from location.models import init_db, Country, State, City, Neighborhood
class formTest(TestCase):
def test_main(self):
init_db() # set up the locations in the DB. Could use a fixture for this.
... | {
"repo_name": "dragonx/django-hier-ajax-form",
"path": "hierform/tests.py",
"copies": "1",
"size": "5737",
"license": "bsd-3-clause",
"hash": -887043188304833700,
"line_mean": 54.1634615385,
"line_max": 148,
"alpha_frac": 0.6196618442,
"autogenerated": false,
"ratio": 3.9729916897506925,
"confi... |
from django.test import TestCase
from django.test.client import RequestFactory
from mock import Mock
from django.template.context import RequestContext
from ..views import PleaOnlineForms
class TestNoJS(TestCase):
def setUp(self):
self.plea_session = {"notice_type": {"complete": True,
... | {
"repo_name": "ministryofjustice/manchester_traffic_offences_pleas",
"path": "apps/plea/tests/test_nojs.py",
"copies": "1",
"size": "8231",
"license": "mit",
"hash": 7112432408528952000,
"line_mean": 41.2102564103,
"line_max": 104,
"alpha_frac": 0.5595917871,
"autogenerated": false,
"ratio": 3.97... |
from django.test import TestCase
from django.test.client import RequestFactory
from myuw.dao.calendar_mapping import \
get_calendars_for_minors, get_calendars_for_majors, \
get_calendars_for_gradmajors, _get_enrollments, \
_get_calendars, _get_calendar_ids_from_text
class TestCalendarMapping(TestCase):
... | {
"repo_name": "fanglinfang/myuw",
"path": "myuw/test/dao/calendar_mapping.py",
"copies": "1",
"size": "2281",
"license": "apache-2.0",
"hash": -261937822661145730,
"line_mean": 33.5606060606,
"line_max": 63,
"alpha_frac": 0.5471284524,
"autogenerated": false,
"ratio": 3.5419254658385095,
"confi... |
from django.test import TestCase
from django.test.client import RequestFactory
from rest_framework.permissions import BasePermission
from rest_framework.views import APIView
from rest_any_permissions.permissions import AnyPermissions
class TestView(APIView):
def test_permission(self, request):
from rest_... | {
"repo_name": "kevin-brown/drf-any-permissions",
"path": "tests/tests/permissions.py",
"copies": "1",
"size": "4338",
"license": "mit",
"hash": -4791469172958239000,
"line_mean": 28.5102040816,
"line_max": 71,
"alpha_frac": 0.6401567543,
"autogenerated": false,
"ratio": 4.7254901960784315,
"con... |
from django.test import TestCase
from django.test.client import RequestFactory
from wms import layers, maps, views
from .models import TestPolygon
TEST_CARTOGRAPHY = [{
'name': 'Category A',
'color': '58 112 38',
'symbol': 'hash'
}]
class VectorLayer(layers.WmsVectorLayer):
model = TestPolygon
c... | {
"repo_name": "geodesign/django-wms",
"path": "tests/test_polygon_view.py",
"copies": "1",
"size": "1180",
"license": "bsd-3-clause",
"hash": -4035363467415616000,
"line_mean": 27.0952380952,
"line_max": 177,
"alpha_frac": 0.6838983051,
"autogenerated": false,
"ratio": 3.2777777777777777,
"conf... |
from django.test import TestCase
from django.test.client import RequestFactory
from medicine.models import ManipulatedMedicine
from medicine.views import ListManipulatedMedicinenByHealthProfessional
from user.models import HealthProfessional
class TestManipulatedMedicineList(TestCase):
def setUp(self):
... | {
"repo_name": "fga-gpp-mds/2017.2-Receituario-Medico",
"path": "medical_prescription/medicine/test/test_view_list_medication_by_heath_professional.py",
"copies": "1",
"size": "1529",
"license": "mit",
"hash": -8737648987106267000,
"line_mean": 35.4047619048,
"line_max": 110,
"alpha_frac": 0.70176586,... |
from django.test import TestCase
from django.test.client import RequestFactory
from opps.contrib.mobile import template
from opps.contrib.mobile.middleware import (
MobileDetectionMiddleware, MobileRedirectMiddleware
)
class TestMobileTemplatesDir(TestCase):
def setUp(self):
self.detection_middlewar... | {
"repo_name": "laborautonomo/opps",
"path": "tests/contrib/test_mobile.py",
"copies": "1",
"size": "2644",
"license": "mit",
"hash": -9206245918779469000,
"line_mean": 43.0666666667,
"line_max": 100,
"alpha_frac": 0.6577155825,
"autogenerated": false,
"ratio": 4.377483443708609,
"config_test": ... |
from django.test import TestCase
from django.test import Client
from apps.quiz.models import Quiz
from apps.quiz.models import Question
from apps.quiz.models import Answer
from django.urls import reverse
from django.template import Context, Template
import unittest
#Model tests
#View tests
class QuizTest(TestCase):
... | {
"repo_name": "Sirikam/Gravitas",
"path": "apps/quiz/tests.py",
"copies": "1",
"size": "1588",
"license": "mit",
"hash": 4532569939071424000,
"line_mean": 31.3673469388,
"line_max": 80,
"alpha_frac": 0.6494325347,
"autogenerated": false,
"ratio": 3.6712962962962963,
"config_test": true,
"has_... |
from django.test import TestCase
from django.test import Client
from common.models import User, Company
from emails.models import Email
from emails.forms import EmailForm
class UserCreation(TestCase):
def setUp(self):
self.client = Client()
self.company, _ = Company.objects.get_or_create(
... | {
"repo_name": "MicroPyramid/Django-CRM",
"path": "emails/tests.py",
"copies": "1",
"size": "5957",
"license": "mit",
"hash": -2658051082097853000,
"line_mean": 32.6553672316,
"line_max": 80,
"alpha_frac": 0.5658888702,
"autogenerated": false,
"ratio": 3.7,
"config_test": true,
"has_no_keyword... |
from django.test import TestCase
from django.test import Client
from django.conf import settings
from ecommerce.models import Product, Category
import json
class ArticlesApiTest(TestCase):
def test_products(self):
headers = {
"HTTP_X_AUTH_TOKEN": settings.AUTH_TOKEN
}
c = Cli... | {
"repo_name": "brady-vitrano/ecommerce-demo",
"path": "api/tests/test_articles.py",
"copies": "1",
"size": "2186",
"license": "apache-2.0",
"hash": -8514524277620954000,
"line_mean": 38.7454545455,
"line_max": 71,
"alpha_frac": 0.6129917658,
"autogenerated": false,
"ratio": 4.203846153846154,
"... |
from django.test import TestCase
from django.test import Client
from django.conf import settings
import unittest
import json
import csv
class VolunteersApiTestCase(TestCase):
activities_base_url = "/api/v1/volunteer_activities"
def setUp(self):
self.client = Client()
self.activity_id = setti... | {
"repo_name": "klpdotorg/dubdubdub",
"path": "unittests/volunteeractivities/test_volunteers.py",
"copies": "1",
"size": "1940",
"license": "mit",
"hash": 1262112788733652500,
"line_mean": 40.2978723404,
"line_max": 91,
"alpha_frac": 0.6824742268,
"autogenerated": false,
"ratio": 4.145299145299146... |
from django.test import TestCase
from django.test import Client
from django.contrib.auth.models import User
from bucketlist.models import Bucketlist, BucketlistItem
from rest_framework.test import APITestCase, APIClient, APIRequestFactory, force_authenticate
from django.core.urlresolvers import reverse
from rest_framew... | {
"repo_name": "andela-tadesanya/django-bucketlist-application",
"path": "bucketlist_django/bucketlist/tests.py",
"copies": "1",
"size": "20276",
"license": "mit",
"hash": -7594969955279551000,
"line_mean": 38.7568627451,
"line_max": 93,
"alpha_frac": 0.5660386664,
"autogenerated": false,
"ratio":... |
from django.test import TestCase
from django.test import Client
from django.contrib.auth.models import User
from django.core import mail
class TestIndexView(TestCase):
@classmethod
def setUpClass(cls):
super(TestCase, cls)
cls.c = Client()
cls.res = cls.c.get('/')
cls.password... | {
"repo_name": "MigrantJ/django-imager",
"path": "imagersite/imagersite/tests.py",
"copies": "2",
"size": "4168",
"license": "mit",
"hash": 3451301422491787300,
"line_mean": 24.8881987578,
"line_max": 62,
"alpha_frac": 0.5904510557,
"autogenerated": false,
"ratio": 3.9136150234741782,
"config_te... |
from django.test import TestCase
from django.test import Client
from django.contrib.auth.models import User
from ..models import Message, UserFollowingRelationship
class ServicesTestCase(TestCase):
def setUp(self):
self.username = 'test'
self.password = '123'
self.email = 'tester@abv.bg'
... | {
"repo_name": "vdtodorov93/Hirundo",
"path": "hirundo/website/tests/tests.py",
"copies": "1",
"size": "5836",
"license": "mit",
"hash": -4824026509301199000,
"line_mean": 35.7044025157,
"line_max": 78,
"alpha_frac": 0.5966415353,
"autogenerated": false,
"ratio": 3.956610169491525,
"config_test"... |
from django.test import TestCase
from django.test import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from rest_framework.test import APIRequestFactory
from rest_framework.test import APIClient
from api.models import *
import urllib2
import unittest
import json
BASEUR... | {
"repo_name": "zztimy/CMPUT404-project-socialdistribution",
"path": "api/tests.py",
"copies": "3",
"size": "10554",
"license": "apache-2.0",
"hash": 3663247839219510000,
"line_mean": 36.0315789474,
"line_max": 109,
"alpha_frac": 0.6508432822,
"autogenerated": false,
"ratio": 3.564336372847011,
... |
from django.test import TestCase
from django.test import Client
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.contrib.auth import SESSION_KEY
from django.utils.six.moves.urllib.parse import urlparse
from users.models import User
class RegisterTestCase(TestCase... | {
"repo_name": "ericmok/djangosimpleblog",
"path": "users/test_views.py",
"copies": "1",
"size": "2120",
"license": "mit",
"hash": 2895644725987284500,
"line_mean": 37.5636363636,
"line_max": 114,
"alpha_frac": 0.6089622642,
"autogenerated": false,
"ratio": 4.344262295081967,
"config_test": true... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.