text stringlengths 0 1.05M | meta dict |
|---|---|
from django.test import TestCase, Client
from website.models import Wedding, Section, WeddingCeremonyVenue, WeddingReceptionVenue, BridalPartyMember
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from mock import patch
from website.helpers import MockDataHelper
###
# Views
##... | {
"repo_name": "toast38coza/WeddingSite",
"path": "website/tests.py",
"copies": "1",
"size": "6346",
"license": "mit",
"hash": 1224848161850141400,
"line_mean": 29.0758293839,
"line_max": 114,
"alpha_frac": 0.7132051686,
"autogenerated": false,
"ratio": 2.8740942028985508,
"config_test": true,
... |
from django.test import TestCase, Client
import http.client
from checkout.models import Order, PickList
from meadery.models import Product
from checkout.checkout import all_in_stock, create_picklist, process_picklist, cancel_picklist
# admin.py
# write tests for processing and cancelling orders from web
# write silly ... | {
"repo_name": "mathuin/pyment",
"path": "django/checkout/tests.py",
"copies": "1",
"size": "5173",
"license": "mit",
"hash": 836709262747920500,
"line_mean": 38.7923076923,
"line_max": 94,
"alpha_frac": 0.6792963464,
"autogenerated": false,
"ratio": 3.7323232323232323,
"config_test": true,
"h... |
from django.test import TestCase, Client
class TestCourseSelection(TestCase):
fixtures = ['basic_setup.json']
def makeNewClient(self):
# Remove any existing clients, make a new one and then login
self.client = None
self.client = Client()
self.client.post('/login/', {'userna... | {
"repo_name": "camerongray1515/SELP-Audience-Response-System",
"path": "flash_response/main/tests/test_course_selection.py",
"copies": "1",
"size": "1691",
"license": "mit",
"hash": -4123193619946444300,
"line_mean": 41.275,
"line_max": 96,
"alpha_frac": 0.6617386162,
"autogenerated": false,
"rat... |
from django.test import TestCase, Client
class TestLogin(TestCase):
fixtures = ['basic_setup.json']
correct_login = {'username': 'tutor1', 'password': '1234'}
# If the user is not logged in, they should be redirected to
# the login page if they try and access the tutor area
def test_not_logged_in(... | {
"repo_name": "camerongray1515/SELP-Audience-Response-System",
"path": "flash_response/main/tests/test_login.py",
"copies": "1",
"size": "1907",
"license": "mit",
"hash": -3027275395272640500,
"line_mean": 40.4565217391,
"line_max": 83,
"alpha_frac": 0.6282118511,
"autogenerated": false,
"ratio":... |
from django.test import TestCase, Client
from pretix.base.models import User
from tests.base import BrowserTest
class LoginFormBrowserTest(BrowserTest):
def setUp(self):
super().setUp()
self.user = User.objects.create_user('dummy@dummy.dummy', 'dummy@dummy.dummy', 'dummy')
def test_login(se... | {
"repo_name": "Unicorn-rzl/pretix",
"path": "src/tests/control/test_auth.py",
"copies": "1",
"size": "3739",
"license": "apache-2.0",
"hash": -2792158345904937000,
"line_mean": 33.9439252336,
"line_max": 95,
"alpha_frac": 0.603369885,
"autogenerated": false,
"ratio": 3.827021494370522,
"config_... |
from django.test import TestCase, Client
# NOTE: disabled these for now but expect they'll be used in the near future
# from django.urls import reverse
# from budget_app.models import OCRB
# from mixer.backend.django import mixer
# from rest_framework import status
# from rest_framework.test import APITestCase
# Other... | {
"repo_name": "hackoregon/team-budget",
"path": "budget_proj/budget_app/tests.py",
"copies": "1",
"size": "5323",
"license": "mit",
"hash": -3654161817041450000,
"line_mean": 31.2606060606,
"line_max": 102,
"alpha_frac": 0.6417433778,
"autogenerated": false,
"ratio": 3.7698300283286117,
"config... |
from django.test import TestCase, Client
try:
from django.contrib.auth import get_user_model
except ImportError: # for Django 1.3 compatibility
from django.contrib.auth.models import User as OldUser
get_user_model = lambda: OldUser
User = get_user_model()
class PasswordSessionTest(TestCase):
def se... | {
"repo_name": "atugushev/django-password-session",
"path": "password_session/tests/tests.py",
"copies": "4",
"size": "1853",
"license": "mit",
"hash": 1012830030866939400,
"line_mean": 38.4468085106,
"line_max": 115,
"alpha_frac": 0.6017269293,
"autogenerated": false,
"ratio": 4.25,
"config_tes... |
from django.test import TestCase, Client, override_settings
from django.core.urlresolvers import reverse
from students.models import Student, Group
@override_settings(LANGUAGE_CODE='en')
class TestStudentUpdateForm(TestCase):
fixtures = ['students_test_data.json']
# @modify_settings
# urls = 'studentsdb... | {
"repo_name": "PyDev777/studentsdb",
"path": "students/tests/test_student_forms.py",
"copies": "1",
"size": "11675",
"license": "mit",
"hash": -2306874310943987000,
"line_mean": 38.7108843537,
"line_max": 144,
"alpha_frac": 0.6534475375,
"autogenerated": false,
"ratio": 4.207207207207207,
"conf... |
from django.test import TestCase, Client, override_settings
from django.utils.timezone import datetime, timedelta, now, make_aware, utc, localtime
from django.utils.six import StringIO, BytesIO
from django.core.urlresolvers import reverse
from django.core import mail
from django.contrib.auth import get_user_model
from ... | {
"repo_name": "mostateresnet/exdbproject",
"path": "exdb/tests/integration_tests.py",
"copies": "1",
"size": "54658",
"license": "mit",
"hash": -1551935874673334800,
"line_mean": 47.5848888889,
"line_max": 132,
"alpha_frac": 0.6204581214,
"autogenerated": false,
"ratio": 3.7807290585875353,
"co... |
from django.test import TestCase, Client, RequestFactory
from django.contrib.auth.models import User
from django.urls import reverse_lazy
from django.core.files.uploadedfile import SimpleUploadedFile
from imager_profile.models import ImagerProfile
from imager_images.models import Photo, Album
from imager_profile.tests ... | {
"repo_name": "midfies/django-imager",
"path": "imagersite/imager_images/tests.py",
"copies": "1",
"size": "15195",
"license": "mit",
"hash": -9158672032163901000,
"line_mean": 40.9751381215,
"line_max": 107,
"alpha_frac": 0.6278381046,
"autogenerated": false,
"ratio": 3.772343594836147,
"confi... |
from django.test import TestCase, Client, RequestFactory
from django.contrib.auth.models import User
from imager_profile.models import ImagerProfile
from imager_profile.views import ProfileView, HomeView
import factory
class UserFactory(factory.django.DjangoModelFactory):
"""Generate test users."""
class Met... | {
"repo_name": "JSchatzman/django-imager",
"path": "imagersite/imager_profile/tests.py",
"copies": "1",
"size": "7884",
"license": "mit",
"hash": -7228058824196284000,
"line_mean": 35,
"line_max": 80,
"alpha_frac": 0.6220192796,
"autogenerated": false,
"ratio": 4.167019027484144,
"config_test": ... |
from django.test import TestCase, Client, RequestFactory
from django.contrib.auth.models import User
from .models import UserProfile
import factory
from django.urls import reverse_lazy
"""Testing imports for 2 Factor Auth.
From https://github.com/Bouke/django-two-factor-auth/blob/master/tests/test_views_login.py."""
f... | {
"repo_name": "rveeblefetzer/IOT-home-inspector",
"path": "IOThomeinspector/userprofile/tests.py",
"copies": "1",
"size": "22945",
"license": "mit",
"hash": -6348982385354871000,
"line_mean": 40.6424682396,
"line_max": 99,
"alpha_frac": 0.5898888647,
"autogenerated": false,
"ratio": 4.16047144152... |
from django.test import TestCase, Client, RequestFactory
from django.http import JsonResponse
from django.urls import reverse_lazy
from django.conf import settings
from twilio.rest import TwilioRestClient
from bs4 import BeautifulSoup as Soup
import factory
import random
from calls.views import call, callview, get_tok... | {
"repo_name": "pyphonic/Pyphon",
"path": "pyphon/calls/tests.py",
"copies": "1",
"size": "9046",
"license": "apache-2.0",
"hash": 6973853259114183000,
"line_mean": 40.6912442396,
"line_max": 101,
"alpha_frac": 0.6101039133,
"autogenerated": false,
"ratio": 3.9815140845070425,
"config_test": tru... |
from django.test import TestCase, Client, RequestFactory
from django.urls import reverse
from django.contrib.auth.models import User
from django.db import IntegrityError
import datetime
from datetime import timedelta
import pytz
from ..models import (
Job,
Task,
Project,
ExternalProject,
ProjectW... | {
"repo_name": "dictoss/active-task-summary",
"path": "ats/tests/tests_models.py",
"copies": "1",
"size": "4378",
"license": "bsd-2-clause",
"hash": 6155888864802017000,
"line_mean": 31.671641791,
"line_max": 82,
"alpha_frac": 0.5555047967,
"autogenerated": false,
"ratio": 3.4229867083659107,
"c... |
from django.test import TestCase, Client, RequestFactory
from user.views import ResetPasswordView
from user.forms import ResetPasswordForm
from user.models import User
class TestResetPassword(TestCase):
def setUp(self):
self.client = Client()
self.factory = RequestFactory()
# Creating us... | {
"repo_name": "fga-gpp-mds/2017.2-Receituario-Medico",
"path": "medical_prescription/user/test/test_view_reset_password.py",
"copies": "1",
"size": "1209",
"license": "mit",
"hash": -5467410237647038000,
"line_mean": 29.225,
"line_max": 69,
"alpha_frac": 0.64681555,
"autogenerated": false,
"ratio... |
from django.test import TestCase, Client, SimpleTestCase
from django.core.urlresolvers import reverse
from app.models import Parent, Teacher
from . import wxapi
class TestWechatPage(TestCase):
def setUp(self):
self.client = Client()
def tearDown(self):
pass
def test_index(self):
... | {
"repo_name": "malaonline/Server",
"path": "server/wechat/tests.py",
"copies": "1",
"size": "6231",
"license": "mit",
"hash": 8350738143105148000,
"line_mean": 38.6878980892,
"line_max": 96,
"alpha_frac": 0.6299149414,
"autogenerated": false,
"ratio": 3.332085561497326,
"config_test": true,
"... |
from django.test import TestCase, LiveServerTestCase, Client
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from selenium import webdriver
import factory
from installer_config.models import EnvironmentProfile, UserChoice, Step
TEST_DOMAIN_NAME = "http://127.0.0.1:8081"
clas... | {
"repo_name": "ezPy-co/ezpy",
"path": "installer/installer_config/tests.py",
"copies": "1",
"size": "13987",
"license": "mit",
"hash": 8556019263698216000,
"line_mean": 39.778425656,
"line_max": 110,
"alpha_frac": 0.6252949167,
"autogenerated": false,
"ratio": 4.051853997682503,
"config_test": ... |
# from django.test import TestCase, LiveServerTestCase, Client
# from django.utils import timezone
# from blogengine.models import Post, Category, Tag
# from django.contrib.flatpages.models import FlatPage
# from django.contrib.sites.models import Site
# from django.contrib.auth.models import User
# import markdown2 as... | {
"repo_name": "EricShiGit/personalblog",
"path": "blogengine/tests.py",
"copies": "1",
"size": "29884",
"license": "mit",
"hash": 5703687587127226000,
"line_mean": 32.9216799092,
"line_max": 104,
"alpha_frac": 0.5679293267,
"autogenerated": false,
"ratio": 3.500937207122774,
"config_test": true... |
from django.test import TestCase, LiveServerTestCase, Client
from django.utils import timezone
from blogengine.models import Post, Category, Tag
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
import markdown
def CreateTag():
# Create the tag
tag = Tag()
tag.n... | {
"repo_name": "daniel924/MyBlog",
"path": "blogengine/tests.py",
"copies": "1",
"size": "15108",
"license": "apache-2.0",
"hash": -8161108807280339000,
"line_mean": 30.7394957983,
"line_max": 175,
"alpha_frac": 0.6517077045,
"autogenerated": false,
"ratio": 3.637852155068625,
"config_test": tru... |
from django.test import TestCase, LiveServerTestCase, Client
from django.utils import timezone
from django.core.urlresolvers import reverse
from django.contrib.sites.models import Site
from django.contrib.auth.models import User
from blog.models import Post, Category, Tag
from django.contrib.flatpages.models import Fla... | {
"repo_name": "itorain/titanobloga",
"path": "blog/tests.py",
"copies": "1",
"size": "21732",
"license": "mit",
"hash": -6989459138967408000,
"line_mean": 34.0516129032,
"line_max": 174,
"alpha_frac": 0.6996594883,
"autogenerated": false,
"ratio": 3.174872169466764,
"config_test": true,
"has_... |
#from django.test import TestCase, LiveServerTestCase
import django.dispatch
from django.conf import settings
testcase_to_extend = getattr(settings, "SPEC_TESTCASE", "LiveServerTestCase")
from django import test
import random
step_done = django.dispatch.Signal(providing_args=["testcase", "test_name" "passed"])
scenar... | {
"repo_name": "CariZa/django-spectacles",
"path": "spectacles/functionaltest.py",
"copies": "1",
"size": "5167",
"license": "mit",
"hash": 8378348667767062000,
"line_mean": 31.7025316456,
"line_max": 115,
"alpha_frac": 0.5989936133,
"autogenerated": false,
"ratio": 3.7853479853479852,
"config_t... |
from django.test import TestCase, modify_settings
from django.urls import reverse
from mymoney.apps.bankaccounts.factories import BankAccountFactory
from ..factories import UserFactory
@modify_settings(MIDDLEWARE={
'remove': ['mymoney.core.middleware.AnonymousRedirectMiddleware'],
})
class HomeRedirectViewTestC... | {
"repo_name": "ychab/mymoney",
"path": "mymoney/core/tests/test_views.py",
"copies": "1",
"size": "1395",
"license": "bsd-3-clause",
"hash": -3060139103578778600,
"line_mean": 30.7045454545,
"line_max": 84,
"alpha_frac": 0.7039426523,
"autogenerated": false,
"ratio": 4.115044247787611,
"config_... |
from django.test import TestCase
from academics.models import Student, AcademicYear, Teacher
# Create your tests here.
class StudentTestCase(TestCase):
def setUp(self):
Student.objects.create(first_name="Adam", last_name="Peacock", student_id="ST00001")
Student.objects.create(first_name="Adam", las... | {
"repo_name": "rectory-school/rectory-apps",
"path": "academics/tests.py",
"copies": "1",
"size": "3412",
"license": "mit",
"hash": -1359178592908074800,
"line_mean": 36.097826087,
"line_max": 114,
"alpha_frac": 0.6755568581,
"autogenerated": false,
"ratio": 3.6220806794055203,
"config_test": t... |
from django.test import TestCase
from accounts.models import User,UserProfile
username = 'username'
first_name = 'Max'
last_name = 'Mustermann'
email = 'foo@example.com'
password = 'password'
ip_address = '127.0.0.1'
class UserTestCase(TestCase):
def setUp(self):
user = User.objects.create(username=userna... | {
"repo_name": "babsey/django-forums-bootstrap",
"path": "accounts/tests.py",
"copies": "1",
"size": "1954",
"license": "bsd-3-clause",
"hash": 2487597707701643300,
"line_mean": 33.8928571429,
"line_max": 86,
"alpha_frac": 0.6673490276,
"autogenerated": false,
"ratio": 3.7941747572815534,
"confi... |
from django.test import TestCase
from accounts.test.test_models import test_user
from projects.test.test_models import test_team, test_project
class ModelsTeam_Projects(TestCase):
def test_TeamHasNoProjects_ProjectsIsEmpty(self):
t = test_team()
self.assertEqual(0, len(t.projects))
def test_... | {
"repo_name": "OmegaDroid/quokka",
"path": "projects/test/unit/test_ModelsTeam_Projects.py",
"copies": "1",
"size": "1026",
"license": "mit",
"hash": 3920242846065413000,
"line_mean": 31.0625,
"line_max": 84,
"alpha_frac": 0.6725146199,
"autogenerated": false,
"ratio": 3.5625,
"config_test": tr... |
from django.test import TestCase
from addressbase.models import Blacklist
from data_finder.helpers import RoutingHelper
class RoutingHelperTest(TestCase):
fixtures = ['test_routing.json']
def test_address_view(self):
rh = RoutingHelper('AA11AA')
endpoint = rh.get_endpoint()
self.asse... | {
"repo_name": "chris48s/UK-Polling-Stations",
"path": "polling_stations/apps/data_finder/tests/test_routing_helper.py",
"copies": "1",
"size": "2371",
"license": "bsd-3-clause",
"hash": -9195958347276432000,
"line_mean": 39.186440678,
"line_max": 74,
"alpha_frac": 0.6786166175,
"autogenerated": fal... |
from django.test import TestCase
from admintools.models import DataQualityIssue
from django.utils import timezone
from opencivicdata.core.models import Jurisdiction, Division
from pupa.models import RunPlan
from admintools.issues import IssueType
class DataQualityIssueModelTests(TestCase):
def setUp(self):
... | {
"repo_name": "hiteshgarg14/admintools",
"path": "admintools/tests/test_models.py",
"copies": "1",
"size": "1147",
"license": "mit",
"hash": -248858634515368130,
"line_mean": 36,
"line_max": 75,
"alpha_frac": 0.6381865737,
"autogenerated": false,
"ratio": 4.067375886524823,
"config_test": false... |
from django.test import TestCase
from angular4django.robot import robot
from rest_framework.test import APIClient
class RobotTestCase(TestCase):
TEST_1 = """46B E59 EA C1F 45E 63
899 FFF 926 7AD C4E FFF
E2E 323 6D2 976 83F C96
9E9 A8B 9C1 461 F74 D05
EDD E94 5F4 D1D D03 DE3
89 925 CF9 CA0 F18 4D2"""
RESULT... | {
"repo_name": "paulskinau/angular4django",
"path": "angular4django/angular4django/api/tests.py",
"copies": "1",
"size": "1128",
"license": "mit",
"hash": 428250810654775700,
"line_mean": 30.3611111111,
"line_max": 95,
"alpha_frac": 0.6533687943,
"autogenerated": false,
"ratio": 2.8629441624365484... |
from django.test import TestCase
from api.models import File, DateMixin
from django.core.files.uploadedfile import SimpleUploadedFile
from django.contrib.auth.models import User
import os
import re
class ModelsTestCase(TestCase):
"""Test suite for the models."""
def setUp(self):
"""Setup variables.""... | {
"repo_name": "gitgik/updown",
"path": "api/tests/test_models.py",
"copies": "1",
"size": "1767",
"license": "mit",
"hash": 7621028646239582000,
"line_mean": 35.8125,
"line_max": 71,
"alpha_frac": 0.6146010187,
"autogenerated": false,
"ratio": 3.9707865168539325,
"config_test": true,
"has_no_... |
from django.test import TestCase
from app.models import Item
class TestFixtures(TestCase):
fixtures = ['items']
def test_fixtures(self):
assert Item.objects.count() == 1
assert Item.objects.all()[0].name == 'Fixture item'
def test_fixtures_again(self):
"""Ensure fixtures a... | {
"repo_name": "bfirsh/pytest_django",
"path": "tests/test_unittest.py",
"copies": "1",
"size": "1639",
"license": "bsd-3-clause",
"hash": -8427022161927901000,
"line_mean": 27.2586206897,
"line_max": 72,
"alpha_frac": 0.6095179988,
"autogenerated": false,
"ratio": 4.046913580246914,
"config_tes... |
from django.test import TestCase
from apps.processing.rsd.models import EventExtent, AdminUnit, EventObservation, EventCategory, CategoryCustomGroup, NumberOfEventsObservation
from apps.importing.models import ProviderLog, Provider
from apps.common.models import Property, Process
from django.contrib.gis.geos import GEO... | {
"repo_name": "gis4dis/poster",
"path": "apps/processing/rsd/tests.py",
"copies": "1",
"size": "5520",
"license": "bsd-3-clause",
"hash": -9053531211418795000,
"line_mean": 35.0588235294,
"line_max": 142,
"alpha_frac": 0.642559362,
"autogenerated": false,
"ratio": 3.742876526458616,
"config_tes... |
from django.test import TestCase
from app.testwatch import TestWatch
def test(a, b):
return a + b
class TestTestWatch(TestCase):
def test_methods(self):
tw = TestWatch()
self.assertTrue(tw.get_calls_count("app.tests.test_testwatch.test") == 0)
self.assertTrue(tw.get_calls_count("app.t... | {
"repo_name": "OpenDroneMap/WebODM",
"path": "app/tests/test_testwatch.py",
"copies": "2",
"size": "1395",
"license": "mpl-2.0",
"hash": -379265003924817900,
"line_mean": 25.320754717,
"line_max": 88,
"alpha_frac": 0.5519713262,
"autogenerated": false,
"ratio": 3.394160583941606,
"config_test":... |
from django.test import TestCase
from arcfire.models import *
# it doesn't make much sense to fill this out until I have factories working correctly.
class RelationTestCase(TestCase):
'''
Relations.
'''
def setUp(self):
pass
class LocationTestCase(TestCase):
'''
Relations.
'''
... | {
"repo_name": "allanberry/arcfire",
"path": "arcfire/arcfire/tests/test_models.py",
"copies": "1",
"size": "1735",
"license": "mit",
"hash": 6429644441180252000,
"line_mean": 12.5625,
"line_max": 87,
"alpha_frac": 0.5544668588,
"autogenerated": false,
"ratio": 4.053738317757009,
"config_test": ... |
from django.test import TestCase
from atmusers.models import ATMUser, Operation
class ATMUserTest(TestCase):
def test_atmuser_creation(self):
atmuser = ATMUser.objects.create_user(card='card',
password='pin',
cash... | {
"repo_name": "andkononykhin/atmsite",
"path": "atmusers/tests/test_models.py",
"copies": "1",
"size": "1972",
"license": "mit",
"hash": -6082787194341861000,
"line_mean": 43.8181818182,
"line_max": 79,
"alpha_frac": 0.5172413793,
"autogenerated": false,
"ratio": 4.441441441441442,
"config_test... |
from django.test import TestCase
from authentication.models import Account
from django.core.exceptions import ValidationError
class AccountTestCase(TestCase):
validAccount = None
def setUp(self):
self.validAccount = Account(email="user1@test.com",username="username1",first_name="First", last_name="Las... | {
"repo_name": "dmham86/CrowdBrew",
"path": "authentication/authentication_tests/test_models.py",
"copies": "1",
"size": "3003",
"license": "mit",
"hash": 3346444952016792600,
"line_mean": 37.5,
"line_max": 164,
"alpha_frac": 0.6976356976,
"autogenerated": false,
"ratio": 4.655813953488372,
"con... |
from django.test import TestCase
from ..base import MqueueBaseTest
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User
from mqueue.models import MEvent
from mqueue import hooks
from mqueue.hooks.redis.serializer import Pack
class MqueueTestRedisHook(MqueueBaseTest):
... | {
"repo_name": "synw/django-mqueue",
"path": "mqueue/tests/hooks/redis.py",
"copies": "1",
"size": "1765",
"license": "mit",
"hash": 6965051780206142000,
"line_mean": 37.3695652174,
"line_max": 69,
"alpha_frac": 0.6141643059,
"autogenerated": false,
"ratio": 3.5159362549800797,
"config_test": tr... |
from django.test import TestCase
from .base import MqueueBaseTest
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User
from mqueue.models import MEvent
class MqueueTestCreate(MqueueBaseTest):
def create_mevent(self, name="M event", url='/', obj_pk=1, notes='Notes... | {
"repo_name": "synw/django-mqueue",
"path": "mqueue/tests/test_create.py",
"copies": "1",
"size": "2487",
"license": "mit",
"hash": 181963082896236450,
"line_mean": 39.7704918033,
"line_max": 84,
"alpha_frac": 0.6172094893,
"autogenerated": false,
"ratio": 3.762481089258699,
"config_test": true... |
from django.test import TestCase
from billing import get_gateway, CreditCard
from billing.gateway import CardNotSupported
from billing.utils.credit_card import Visa
from django.utils.unittest.case import skipIf
import stripe
from django.conf import settings
@skipIf(not settings.MERCHANT_SETTINGS.get("stripe", None), "... | {
"repo_name": "spookylukey/merchant",
"path": "billing/tests/stripe_tests.py",
"copies": "1",
"size": "3855",
"license": "bsd-3-clause",
"hash": 5475103238295953000,
"line_mean": 41.8333333333,
"line_max": 89,
"alpha_frac": 0.646692607,
"autogenerated": false,
"ratio": 4.079365079365079,
"confi... |
from django.test import TestCase
from billing import get_integration
from django.template import Template, Context
from django.conf import settings
class AmazonFPSTestCase(TestCase):
urls = "billing.tests.test_urls"
def setUp(self):
self.fps = get_integration("amazon_fps")
fields = {
... | {
"repo_name": "yceruto/merchant",
"path": "billing/tests/amazon_fps_tests.py",
"copies": "1",
"size": "1404",
"license": "bsd-3-clause",
"hash": 7121567240486939000,
"line_mean": 55.16,
"line_max": 585,
"alpha_frac": 0.6866096866,
"autogenerated": false,
"ratio": 3.366906474820144,
"config_test... |
from django.test import TestCase
from billing.utils.credit_card import CreditCard
from billing import get_gateway, GatewayNotConfigured, get_integration, IntegrationNotConfigured
from django.conf import settings
from django.template import Template, Context, TemplateSyntaxError
class MerchantTestCase(TestCase):
d... | {
"repo_name": "yceruto/merchant",
"path": "billing/tests/base_tests.py",
"copies": "1",
"size": "2392",
"license": "bsd-3-clause",
"hash": -2896898950054420000,
"line_mean": 40.2413793103,
"line_max": 136,
"alpha_frac": 0.6070234114,
"autogenerated": false,
"ratio": 4.774451097804391,
"config_t... |
from django.test import TestCase
from busstops.models import Region, Operator, DataSource, Service
from ...models import VehicleLocation, Vehicle
from ..commands import import_bushub
class BusHubTest(TestCase):
@classmethod
def setUpTestData(cls):
Region.objects.create(id='WM')
Operator.object... | {
"repo_name": "jclgoodwin/bustimes.org.uk",
"path": "vehicles/management/tests/test_import_live_bushub.py",
"copies": "1",
"size": "3781",
"license": "mpl-2.0",
"hash": -3470944261327394000,
"line_mean": 41.9659090909,
"line_max": 115,
"alpha_frac": 0.6022216345,
"autogenerated": false,
"ratio": ... |
from django.test import TestCase
from bustimes.models import Route
from .models import (
Region, AdminArea, DataSource, District, Locality, Operator, Service, StopPoint
)
from .admin import OperatorAdmin
class RegionTests(TestCase):
@classmethod
def setUpTestData(cls):
# Create some regions
... | {
"repo_name": "jclgoodwin/bustimes.org.uk",
"path": "busstops/test_models.py",
"copies": "1",
"size": "7258",
"license": "mpl-2.0",
"hash": -1484693801296334000,
"line_mean": 45.2038216561,
"line_max": 118,
"alpha_frac": 0.6570168183,
"autogenerated": false,
"ratio": 3.377094972067039,
"config_... |
from django.test import TestCase
from casexml.apps.case.cleanup import safe_hard_delete
from casexml.apps.case.exceptions import CommCareCaseError
from casexml.apps.case.mock import CaseFactory, CaseStructure, CaseRelationship
from casexml.apps.case.models import CommCareCase
from couchforms.models import XFormInstance... | {
"repo_name": "puttarajubr/commcare-hq",
"path": "corehq/ex-submodules/casexml/apps/case/tests/test_delete.py",
"copies": "2",
"size": "2270",
"license": "bsd-3-clause",
"hash": 602691521891601200,
"line_mean": 41.037037037,
"line_max": 113,
"alpha_frac": 0.659030837,
"autogenerated": false,
"rat... |
from django.test import TestCase
from casexml.apps.case.mock import CaseBlock
from casexml.apps.case.models import CommCareCase
from casexml.apps.case.tests.util import check_user_has_case
from casexml.apps.case.util import post_case_blocks
from casexml.apps.case.xml import V1, V2
from corehq.apps.domain.shortcuts impo... | {
"repo_name": "puttarajubr/commcare-hq",
"path": "corehq/apps/hqcase/tests/test_case_sharing.py",
"copies": "3",
"size": "5350",
"license": "bsd-3-clause",
"hash": -894585292048239600,
"line_mean": 37.4892086331,
"line_max": 140,
"alpha_frac": 0.5678504673,
"autogenerated": false,
"ratio": 3.5954... |
from django.test import TestCase
from casexml.apps.case.mock import CaseBlock
from casexml.apps.case.models import CommCareCase
from casexml.apps.case.util import post_case_blocks
from casexml.apps.case.xml import V2
from corehq.apps.sofabed.models import CaseData, CASE_NAME_LEN
from datetime import date, datetime, tim... | {
"repo_name": "benrudolph/commcare-hq",
"path": "corehq/apps/sofabed/tests/test_casedata.py",
"copies": "1",
"size": "5792",
"license": "bsd-3-clause",
"hash": -6809789373243060000,
"line_mean": 39.5034965035,
"line_max": 80,
"alpha_frac": 0.5921961326,
"autogenerated": false,
"ratio": 3.86907147... |
from django.test import TestCase
from casexml.apps.case.mock import CaseBlock
from casexml.apps.case.tests.util import check_user_has_case
from casexml.apps.case.util import post_case_blocks
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.groups.models import Group
from corehq.apps.users.models ... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "corehq/apps/hqcase/tests/test_case_sharing.py",
"copies": "1",
"size": "4579",
"license": "bsd-3-clause",
"hash": 1146997905841734500,
"line_mean": 35.632,
"line_max": 127,
"alpha_frac": 0.5708670015,
"autogenerated": false,
"ratio": 3.43768768768... |
from django.test import TestCase
from casexml.apps.case.mock import CaseFactory, CaseStructure, CaseIndex
from casexml.apps.case.tests.util import delete_all_cases
from casexml.apps.case.tests.util import extract_caseblocks_from_xml
from casexml.apps.case.xml import V2
from casexml.apps.phone.restore import RestoreConf... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "corehq/apps/hqcase/tests/test_loadtest_users.py",
"copies": "1",
"size": "3939",
"license": "bsd-3-clause",
"hash": 2980810353684824000,
"line_mean": 42.7666666667,
"line_max": 99,
"alpha_frac": 0.6501650165,
"autogenerated": false,
"ratio": 3.620... |
from django.test import TestCase
from casexml.apps.case.mock import CaseFactory
from casexml.apps.case.models import CommCareCase
from casexml.apps.case.signals import cases_received
from casexml.apps.case.xform import process_cases_with_casedb
from corehq.form_processor.interfaces.processor import FormProcessorInterfa... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "corehq/ex-submodules/casexml/apps/case/tests/test_signals.py",
"copies": "2",
"size": "1092",
"license": "bsd-3-clause",
"hash": -7058917346187875000,
"line_mean": 39.4444444444,
"line_max": 94,
"alpha_frac": 0.7106227106,
"autogenerated": false,
... |
from django.test import TestCase
from casexml.apps.case.models import CommCareCase
from casexml.apps.case.tests import delete_all_cases
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.hqcase.utils import get_case_ids_in_domain, get_cases_in_domain
from corehq.apps.importer.tasks import do_import... | {
"repo_name": "SEL-Columbia/commcare-hq",
"path": "corehq/apps/importer/tests.py",
"copies": "1",
"size": "10684",
"license": "bsd-3-clause",
"hash": 1589441302605486600,
"line_mean": 43.3319502075,
"line_max": 121,
"alpha_frac": 0.6432047922,
"autogenerated": false,
"ratio": 3.641445126107703,
... |
from django.test import TestCase
from casexml.apps.case.models import CommCareCase
from casexml.apps.case.tests import delete_all_cases
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.hqcase.utils import get_case_ids_in_domain, get_cases_in_domain
from corehq.apps.importer.tasks import do_impor... | {
"repo_name": "benrudolph/commcare-hq",
"path": "corehq/apps/importer/tests.py",
"copies": "1",
"size": "12578",
"license": "bsd-3-clause",
"hash": 6520369822204911000,
"line_mean": 42.979020979,
"line_max": 121,
"alpha_frac": 0.6357131499,
"autogenerated": false,
"ratio": 3.6896450572015254,
"... |
from django.test import TestCase
from casexml.apps.case.models import CommCareCase
from corehq.apps.casegroups.dbaccessors import get_case_groups_in_domain, \
get_number_of_case_groups_in_domain, get_case_group_meta_in_domain
from corehq.apps.casegroups.models import CommCareCaseGroup
from corehq.util.test_utils im... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "corehq/apps/casegroups/tests.py",
"copies": "1",
"size": "2359",
"license": "bsd-3-clause",
"hash": 9186383624346420000,
"line_mean": 39.6724137931,
"line_max": 75,
"alpha_frac": 0.6023738872,
"autogenerated": false,
"ratio": 3.52089552238806,
"... |
from django.test import TestCase
from casexml.apps.case.models import CommCareCase
from corehq.apps.commtrack.dbaccessors import \
get_supply_point_ids_in_domain_by_location, \
get_supply_points_json_in_domain_by_location, \
get_supply_point_case_by_location_id, get_supply_point_case_by_location
from corehq... | {
"repo_name": "puttarajubr/commcare-hq",
"path": "corehq/apps/commtrack/tests/test_dbaccessors.py",
"copies": "1",
"size": "2842",
"license": "bsd-3-clause",
"hash": -6619824990613573000,
"line_mean": 42.0606060606,
"line_max": 76,
"alpha_frac": 0.6386347643,
"autogenerated": false,
"ratio": 3.58... |
from django.test import TestCase
from casexml.apps.case.models import CommCareCase
from corehq.apps.commtrack.models import CommtrackConfig, ConsumptionConfig, StockRestoreConfig
from corehq.apps.commtrack.tests.util import bootstrap_domain
from corehq.apps.consumption.shortcuts import set_default_consumption_for_domai... | {
"repo_name": "gmimano/commcaretest",
"path": "corehq/apps/commtrack/tests/test_settings.py",
"copies": "1",
"size": "2007",
"license": "bsd-3-clause",
"hash": 3758551637116707300,
"line_mean": 54.75,
"line_max": 107,
"alpha_frac": 0.7304434479,
"autogenerated": false,
"ratio": 3.8374760994263863... |
from django.test import TestCase
from casexml.apps.case.tests.util import delete_all_cases
from corehq.apps.callcenter.utils import sync_call_center_user_case
from corehq.apps.domain.models import CallCenterProperties
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.locations.models import Locati... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "corehq/apps/callcenter/tests/test_location_owners.py",
"copies": "1",
"size": "3848",
"license": "bsd-3-clause",
"hash": 7289034607237662000,
"line_mean": 33.6666666667,
"line_max": 97,
"alpha_frac": 0.6652806653,
"autogenerated": false,
"ratio": ... |
from django.test import TestCase
from catalog.models import Author
class AuthorModelTest(TestCase):
@classmethod
def setUpTestData(cls):
#Set up non-modified objects used by all test methods
Author.objects.create(first_name='Big', last_name='Bob')
def test_first_name_label(self):
... | {
"repo_name": "KimMichaelJones/mdn_tutorial",
"path": "catalog/templates/test_models.py",
"copies": "1",
"size": "1322",
"license": "mpl-2.0",
"hash": -124717447120906530,
"line_mean": 34.7297297297,
"line_max": 78,
"alpha_frac": 0.6724659607,
"autogenerated": false,
"ratio": 3.544235924932976,
... |
from django.test import TestCase
from cfsite.apps.crawlers.deduplication import SimpleDeduplicator
from cfsite.apps.events.models import Location, Category, Event
from datetime import datetime
class OneEventInDbDeduplicationTestCase(TestCase):
def setUp(self):
"""Populate database with only one event"""
... | {
"repo_name": "susanctu/Crazyfish-Public",
"path": "cfsite/apps/crawlers/tests.py",
"copies": "1",
"size": "2067",
"license": "mit",
"hash": 25620461823857610,
"line_mean": 35.9107142857,
"line_max": 122,
"alpha_frac": 0.6047411708,
"autogenerated": false,
"ratio": 4.158953722334004,
"config_te... |
from django.test import TestCase
from channels.models import Channel
from links.models import Link
from django.contrib.auth.models import User
from qhonuskan_votes.utils import get_vote_model
from datetime import datetime, timedelta
from links.utils import context_builder
from django.core.handlers.base import BaseHandl... | {
"repo_name": "linkfloyd/linkfloyd",
"path": "linkfloyd/links/tests.py",
"copies": "1",
"size": "2347",
"license": "bsd-3-clause",
"hash": 455741457124541700,
"line_mean": 35.1076923077,
"line_max": 84,
"alpha_frac": 0.5798892203,
"autogenerated": false,
"ratio": 4.461977186311787,
"config_test... |
from django.test import TestCase
from chatterbot.storage import DjangoStorageAdapter
from chatterbot.ext.django_chatterbot.models import Statement as StatementModel
from chatterbot.ext.django_chatterbot.models import Response as ResponseModel
class DjangoAdapterTestCase(TestCase):
def setUp(self):
"""
... | {
"repo_name": "Reinaesaya/OUIRL-ChatBot",
"path": "tests_django/test_django_adapter.py",
"copies": "1",
"size": "12557",
"license": "bsd-3-clause",
"hash": 1734141100230200600,
"line_mean": 34.9799426934,
"line_max": 99,
"alpha_frac": 0.6597913514,
"autogenerated": false,
"ratio": 4.1814851814851... |
from django.test import TestCase
from cities.dao import MongoDao
class MongoDaoTestCase(TestCase):
def setUp(self):
self.dao = MongoDao()
self.dao.collection.delete_many({})
self.current_timestamp = 10
self.city_1 = {
'_id': 1,
'name': 'Serra',
'... | {
"repo_name": "vinicius-ronconi/WeatherForecast",
"path": "cities/tests/dao_tests.py",
"copies": "1",
"size": "1896",
"license": "mit",
"hash": 8957003878300012000,
"line_mean": 40.2173913043,
"line_max": 103,
"alpha_frac": 0.5738396624,
"autogenerated": false,
"ratio": 3.2633390705679863,
"con... |
from django.test import TestCase
from cljs_loader import loader
class LoaderFigwheelTestCase(TestCase):
def test_config_as_vector(self):
with self.settings(CLJS_LOADER={
'PROJECT_FILE': 'project1.clj',
'ROOT': 'assets/public/out/',
'FIGWHEEL': True
}... | {
"repo_name": "jstaffans/django-cljs-loader",
"path": "tests/app/tests/test_loader.py",
"copies": "1",
"size": "2883",
"license": "mit",
"hash": -3826846789658565600,
"line_mean": 32.1379310345,
"line_max": 68,
"alpha_frac": 0.4190079778,
"autogenerated": false,
"ratio": 4.3353383458646615,
"co... |
from django.test import TestCase
from cms.api import add_plugin, create_page
from djangocms_picture.cms_plugins import PicturePlugin
from ..templatetags.cms_pages import placeholder_content
class PlaceholderContentTest(TestCase):
def test_placeholder_content_concatenates_plugin_bodies(self):
page = crea... | {
"repo_name": "okfn/website",
"path": "foundation/search/tests/test_templatetags.py",
"copies": "2",
"size": "1027",
"license": "mit",
"hash": -377698584797037250,
"line_mean": 37.037037037,
"line_max": 70,
"alpha_frac": 0.6815968841,
"autogenerated": false,
"ratio": 3.6035087719298247,
"config... |
from django.test import TestCase
from cmsplugin_yandex_maps.forms import *
class YandexMapsFormTestCase(TestCase):
def setUp(self):
self.form_data = {'title': 'YandexMapsFormTestCase', 'map_type': 'map', 'lang': 'ru_RU',
'auto_placement': True, 'zoom': 12, 'min_zoom': 0, 'max_zoom': ... | {
"repo_name": "Atterratio/cmsplugin-yandex-maps",
"path": "cmsplugin_yandex_maps/tests/test_forms.py",
"copies": "1",
"size": "8288",
"license": "mit",
"hash": -8509800670775054000,
"line_mean": 37.9154929577,
"line_max": 104,
"alpha_frac": 0.5616554054,
"autogenerated": false,
"ratio": 3.6591611... |
from django.test import TestCase
from collections import OrderedDict
from survey.templatetags.chart_template_tags import get_computational_value_by_answer
from survey.models.locations import *
class ChartTemplateTagsTest(TestCase):
def setUp(self):
self.country = LocationType.objects.create(
... | {
"repo_name": "unicefuganda/uSurvey",
"path": "survey/tests/template_tags/test_charts_template_tags.py",
"copies": "1",
"size": "1565",
"license": "bsd-3-clause",
"hash": -3749581308368188000,
"line_mean": 47.9375,
"line_max": 85,
"alpha_frac": 0.6517571885,
"autogenerated": false,
"ratio": 3.656... |
from django.test import TestCase
from common.data_utilities import DataUtils
from dptable.stats_functions import StatsFunctions
import common.constant as c
class TestStatsFunctions(TestCase):
def setUp(self):
selected_attributes = {
"Age":"C",
"workclass":"D",
"fnlwgt":"C",
"education":"D",
"educat... | {
"repo_name": "JiaMingLin/de-identification",
"path": "test/test_stats_functions.py",
"copies": "1",
"size": "1118",
"license": "apache-2.0",
"hash": 5626544275342855000,
"line_mean": 30.0555555556,
"line_max": 320,
"alpha_frac": 0.656529517,
"autogenerated": false,
"ratio": 3.013477088948787,
... |
from django.test import TestCase
from companysettings.models import InterviewStage
from ..factories._companysettings import InterviewStageFactory
from ..factories._companies import CompanyFactory
class InterviewStageModelTests(TestCase):
def test_unicode(self):
stage = InterviewStageFactory.build()
... | {
"repo_name": "hizardapp/Hizard",
"path": "hyrodactil/tests/companysettings/test_models.py",
"copies": "1",
"size": "1670",
"license": "mit",
"hash": 7132073739507601000,
"line_mean": 35.3043478261,
"line_max": 82,
"alpha_frac": 0.7173652695,
"autogenerated": false,
"ratio": 4.053398058252427,
... |
from django.test import TestCase
from .compiler import Compiler
# Create your tests here.
#run compiler script
#show output
'''
class CompilerTest(TestCase):
errored_python_code = "pint 5"
def setUp(self):
self.file_name = "unit_test_program.py"
def test_simple_print(self):
"""
... | {
"repo_name": "Mihai925/EduCoding",
"path": "Compiler/test.py",
"copies": "1",
"size": "1407",
"license": "mit",
"hash": -5946970289445217000,
"line_mean": 29.6086956522,
"line_max": 99,
"alpha_frac": 0.6119402985,
"autogenerated": false,
"ratio": 4.0315186246418335,
"config_test": true,
"has... |
from django.test import TestCase
from complaints.models import Building
class BuildingTestCase(TestCase):
""" Tests for the Building model.
"""
def setUp(self):
self.b1_name = 'The University of Toronto'
self.b1_civic_address = '27 King\'s College Circle'
self.b1_city = 'Toronto'
... | {
"repo_name": "CSC301H-Fall2013/healthyhome",
"path": "complaints/tests/test_model_building.py",
"copies": "1",
"size": "2729",
"license": "mit",
"hash": -724728694180564500,
"line_mean": 29.6629213483,
"line_max": 79,
"alpha_frac": 0.6101135947,
"autogenerated": false,
"ratio": 3.663087248322147... |
from django.test import TestCase
from config.models import *
from .models import *
from django.contrib.auth.models import User
class TestViews(TestCase):
def setUp(self):
self.admin = User.objects.create_superuser('1234', 'test@test.com', '1234')
self.config = Config.objects.create(pk=1, title='Dblog title', sub... | {
"repo_name": "xXcoronaXx/Dblog",
"path": "statics_pages/tests.py",
"copies": "1",
"size": "1150",
"license": "mit",
"hash": -2661459946420580400,
"line_mean": 36.1290322581,
"line_max": 96,
"alpha_frac": 0.7130434783,
"autogenerated": false,
"ratio": 2.8535980148883375,
"config_test": true,
... |
from django.test import TestCase
from corehq.apps.cloudcare.dbaccessors import get_application_access_for_domain
from corehq.apps.cloudcare.models import ApplicationAccess
class DBAccessorsTest(TestCase):
def test_get_application_access_for_domain(self):
application_access_objects = []
domain = '... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "corehq/apps/cloudcare/tests/test_dbaccessors.py",
"copies": "1",
"size": "1089",
"license": "bsd-3-clause",
"hash": 7595584329724911000,
"line_mean": 37.8928571429,
"line_max": 79,
"alpha_frac": 0.621671258,
"autogenerated": false,
"ratio": 4.2705... |
from django.test import TestCase
from corehq.apps.consumption.shortcuts import get_default_consumption, set_default_consumption_for_domain, set_default_consumption_for_product, set_default_consumption_for_supply_point
from .models import DefaultConsumption, TYPE_DOMAIN, TYPE_PRODUCT, TYPE_SUPPLY_POINT_TYPE, TYPE_SUPPLY... | {
"repo_name": "gmimano/commcaretest",
"path": "corehq/apps/consumption/tests.py",
"copies": "1",
"size": "8931",
"license": "bsd-3-clause",
"hash": -4596234253828514000,
"line_mean": 57.3725490196,
"line_max": 184,
"alpha_frac": 0.7064158549,
"autogenerated": false,
"ratio": 3.5244672454617207,
... |
from django.test import TestCase
from corehq.apps.consumption.shortcuts import (get_default_consumption, set_default_monthly_consumption_for_domain,
set_default_consumption_for_product, set_default_consumption_for_supply_point,
get_loaded_default_consumption, build_consumption_dict
)
from .models import Default... | {
"repo_name": "SEL-Columbia/commcare-hq",
"path": "corehq/apps/consumption/tests.py",
"copies": "3",
"size": "9766",
"license": "bsd-3-clause",
"hash": -3372720358447709700,
"line_mean": 55.1264367816,
"line_max": 130,
"alpha_frac": 0.7109359001,
"autogenerated": false,
"ratio": 3.532007233273056... |
from django.test import TestCase
from corehq.apps.domain.models import Domain
from corehq.apps.sms.mixin import SMSBackend, BackendMapping, BadSMSConfigException
from corehq.apps.sms.api import send_sms, send_sms_to_verified_number, send_sms_with_backend, send_sms_with_backend_name, BackendAuthorizationException
from c... | {
"repo_name": "SEL-Columbia/commcare-hq",
"path": "corehq/apps/sms/tests/__init__.py",
"copies": "1",
"size": "17843",
"license": "bsd-3-clause",
"hash": -6567885513017039000,
"line_mean": 44.1721518987,
"line_max": 151,
"alpha_frac": 0.6789777504,
"autogenerated": false,
"ratio": 3.7587950284390... |
from django.test import TestCase
from corehq.apps.facilities.dbaccessors import \
get_facility_registries_in_domain
from corehq.apps.facilities.models import FacilityRegistry
class DBAccessorsTest(TestCase):
def test_get_facility_registries_in_domain(self):
objects = []
domain = 'facility-regi... | {
"repo_name": "puttarajubr/commcare-hq",
"path": "corehq/apps/facilities/tests.py",
"copies": "1",
"size": "1059",
"license": "bsd-3-clause",
"hash": -4809911868709155000,
"line_mean": 36.8214285714,
"line_max": 81,
"alpha_frac": 0.5930122757,
"autogenerated": false,
"ratio": 3.966292134831461,
... |
from django.test import TestCase
from corehq.apps.groups.models import Group
from corehq.apps.reports.util import case_users_filter, case_group_filter
from corehq.apps.users.models import CommCareUser
def _mock_case(owner, user):
return {
'owner_id': owner,
'user_id': user,
}
class CaseExport... | {
"repo_name": "puttarajubr/commcare-hq",
"path": "corehq/apps/reports/tests/test_case_export.py",
"copies": "3",
"size": "3126",
"license": "bsd-3-clause",
"hash": 1918835954872501800,
"line_mean": 50.262295082,
"line_max": 104,
"alpha_frac": 0.6564299424,
"autogenerated": false,
"ratio": 3.59310... |
from django.test import TestCase
from corehq.apps.hqadmin.dbaccessors import get_all_forms_in_all_domains
from couchforms.models import XFormInstance
from couchforms.util import SubmissionPost
import os
from corehq.apps.sofabed.models import FormData
from datetime import date, datetime
class FormDataTestCase(TestCase... | {
"repo_name": "puttarajubr/commcare-hq",
"path": "corehq/apps/sofabed/tests/test_formdata.py",
"copies": "1",
"size": "3028",
"license": "bsd-3-clause",
"hash": -6679383646188040000,
"line_mean": 39.3733333333,
"line_max": 108,
"alpha_frac": 0.6747027741,
"autogenerated": false,
"ratio": 3.679222... |
from django.test import TestCase
from corehq.apps.users.models import WebUser, CommCareUser
from corehq.apps.users.dbaccessors.all_commcare_users import get_all_commcare_users_by_domain
from corehq.apps.domain.models import Domain
class AllCommCareUsersTest(TestCase):
def setUp(self):
self.ccdomain = Doma... | {
"repo_name": "puttarajubr/commcare-hq",
"path": "corehq/apps/users/tests/test_db_accessors.py",
"copies": "1",
"size": "1739",
"license": "bsd-3-clause",
"hash": -592749548438074400,
"line_mean": 36,
"line_max": 107,
"alpha_frac": 0.6244968373,
"autogenerated": false,
"ratio": 3.739784946236559,... |
from django.test import TestCase
from corehq.apps.users.models import WebUser, CommCareUser
from corehq.apps.users.dbaccessors.all_commcare_users import (
get_all_commcare_users_by_domain,
get_user_docs_by_username,
delete_all_users,
get_all_user_ids,
get_deleted_user_by_username,
get_all_userna... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "corehq/apps/users/tests/test_db_accessors.py",
"copies": "1",
"size": "4353",
"license": "bsd-3-clause",
"hash": -1316932207272287700,
"line_mean": 37.1842105263,
"line_max": 107,
"alpha_frac": 0.6273834137,
"autogenerated": false,
"ratio": 3.4907... |
from django.test import TestCase
from corehq.apps.users.models import WebUser
from corehq.apps.domain.models import Domain
from corehq.apps.hqwebapp.forms import EmailAuthenticationForm
class PasswordLockoutTest(TestCase):
def setUp(self):
self.domain = Domain.get_or_create_with_name('qwerty', is_active=... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "corehq/apps/hqwebapp/tests/test_password_lockout.py",
"copies": "1",
"size": "1128",
"license": "bsd-3-clause",
"hash": -4955077226944141000,
"line_mean": 37.8965517241,
"line_max": 100,
"alpha_frac": 0.6826241135,
"autogenerated": false,
"ratio":... |
from django.test import TestCase
from corehq.apps.users.models import WebUser
from corehq.apps.domain.shortcuts import create_domain
from django.test.client import Client
from django.core.urlresolvers import reverse
import os
from couchforms.dbaccessors import get_forms_by_type, clear_forms_in_domain
from dimagi.utils.... | {
"repo_name": "puttarajubr/commcare-hq",
"path": "corehq/apps/receiverwrapper/tests/test_submit_errors.py",
"copies": "1",
"size": "4156",
"license": "bsd-3-clause",
"hash": -9109684612699447000,
"line_mean": 35.7787610619,
"line_max": 81,
"alpha_frac": 0.5753128008,
"autogenerated": false,
"rati... |
from django.test import TestCase
from corehq import Domain
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.users.models import CommCareUser
from django_digest.test import Client
class DigestOtaRestoreTest(TestCase):
"""
Integration test for django_digest based ota restore is tested
... | {
"repo_name": "benrudolph/commcare-hq",
"path": "corehq/apps/ota/tests/digest_restore.py",
"copies": "4",
"size": "1746",
"license": "bsd-3-clause",
"hash": 7038488383693782000,
"line_mean": 31.9433962264,
"line_max": 143,
"alpha_frac": 0.6798396334,
"autogenerated": false,
"ratio": 3.68354430379... |
from django.test import TestCase
from corehq import ReportConfiguration
from corehq.apps.userreports.dbaccessors import get_report_configs_for_domain, \
get_all_report_configs, get_number_of_report_configs_by_data_source
class DBAccessorsTest(TestCase):
@classmethod
def setUpClass(cls):
cls.data_s... | {
"repo_name": "puttarajubr/commcare-hq",
"path": "corehq/apps/userreports/tests/test_dbaccessors.py",
"copies": "1",
"size": "2085",
"license": "bsd-3-clause",
"hash": -4263785644780220000,
"line_mean": 41.5510204082,
"line_max": 80,
"alpha_frac": 0.6095923261,
"autogenerated": false,
"ratio": 3.... |
from django.test import TestCase
from core.models import Food, FoodGroup, Unit, Equivalence, Preparation
class CoreStringTest (TestCase):
"""Test correct string formatting of core models.
"""
fixtures = [
'test_food',
'test_unit',
'test_equivalence',
]
def test_food_string(s... | {
"repo_name": "wapcaplet/vittles",
"path": "core/tests/formatting.py",
"copies": "1",
"size": "1481",
"license": "mit",
"hash": 2119887116037656600,
"line_mean": 33.4418604651,
"line_max": 93,
"alpha_frac": 0.6103983795,
"autogenerated": false,
"ratio": 3.389016018306636,
"config_test": true,
... |
from django.test import TestCase
from core.notifications.models import Notification
from django.contrib.auth import get_user_model
class NotificationsTest(TestCase):
fixtures = ['core-test-fixtures.json', ]
"""Test whether the method "get_and_mark_unread" updates the DB even
if there are no new notifica... | {
"repo_name": "Ooblioob/collab",
"path": "core/notifications/tests.py",
"copies": "5",
"size": "3951",
"license": "cc0-1.0",
"hash": 710288200419416400,
"line_mean": 39.3163265306,
"line_max": 79,
"alpha_frac": 0.6228802835,
"autogenerated": false,
"ratio": 4.221153846153846,
"config_test": tru... |
from django.test import TestCase
from core.services.freckle import Freckle
from datetime import datetime
class TestServices(TestCase):
"""docstring for TestServices"""
def setUp(self):
self.client = Freckle('8zh8ny1wlym4ljyi68p0je410s1aj8b', 'andela')
self.users = self.client.get_users()
... | {
"repo_name": "ojengwa/reportr",
"path": "core/services/tests.py",
"copies": "2",
"size": "1048",
"license": "mit",
"hash": -8340232378372974000,
"line_mean": 32.8064516129,
"line_max": 87,
"alpha_frac": 0.6669847328,
"autogenerated": false,
"ratio": 3.2546583850931676,
"config_test": true,
"... |
from django.test import TestCase
from couchexport.export import ExportConfiguration
from dimagi.utils.couch.database import get_safe_write_kwargs, get_db
from couchexport.util import clear_attachments, clear_computed
class CleanupTest(TestCase):
def testAttachmentsRemoved(self):
db = get_db()
res... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "corehq/ex-submodules/couchexport/tests/test_cleanup.py",
"copies": "1",
"size": "2589",
"license": "bsd-3-clause",
"hash": -6241489564764269000,
"line_mean": 38.2272727273,
"line_max": 101,
"alpha_frac": 0.5855542681,
"autogenerated": false,
"rati... |
from django.test import TestCase
from couchforms.models import XFormInstance
from couchforms.util import post_xform_to_couch
import os
import json
from dimagi.utils.couch.database import get_db
from ..config import DocumentTransform
from ..deidentification.forms import deidentify_form
class FormDeidentificationTestCas... | {
"repo_name": "gmimano/commcaretest",
"path": "corehq/apps/domainsync/tests/test_deidentification.py",
"copies": "1",
"size": "2175",
"license": "bsd-3-clause",
"hash": -2763023906546388500,
"line_mean": 41.6666666667,
"line_max": 101,
"alpha_frac": 0.6588505747,
"autogenerated": false,
"ratio": ... |
from django.test import TestCase
from .coursecatalog import CourseCatalog as coursecatalog
from ..courses.course import Course as course
from ..courses.lecture import Lecture
from ..courses.lab import Lab
from ..courses.tutorial import Tutorial
from ..event.event import Event
import django.db
class TestDatabases(Test... | {
"repo_name": "foxtrot94/EchelonPlanner",
"path": "src/app/subsystem/database/test_database.py",
"copies": "1",
"size": "17216",
"license": "mit",
"hash": 1397501327048774400,
"line_mean": 50.8584337349,
"line_max": 188,
"alpha_frac": 0.656482342,
"autogenerated": false,
"ratio": 3.92432186004103... |
from django.test import TestCase
from coursedashboards.models import User
from coursedashboards.dao.pws import get_person_by_netid
from coursedashboards.dao.person import get_person_from_regid
from coursedashboards.dao.user import _user_from_person, user_from_person
class TestGetUser(TestCase):
def test_get_alum... | {
"repo_name": "uw-it-aca/course-dashboards",
"path": "coursedashboards/tests/dao/test_user.py",
"copies": "1",
"size": "2448",
"license": "apache-2.0",
"hash": 1252727034020531200,
"line_mean": 31.64,
"line_max": 74,
"alpha_frac": 0.647875817,
"autogenerated": false,
"ratio": 3.0831234256926954,
... |
from django.test import TestCase
from css.models import *
# class FacultyCoursePreferences(models.Model):
# faculty = models.ForeignKey(CUser, on_delete = models.CASCADE)
# course = models.ForeignKey(Course, on_delete = models.CASCADE)
# rank = models.IntegerField(default = 0)
# @classmethod
# def... | {
"repo_name": "makennajohnstone/CSS",
"path": "tests/test_faculty_course_preferences.py",
"copies": "1",
"size": "2442",
"license": "mit",
"hash": 1485186555298442800,
"line_mean": 41.1034482759,
"line_max": 105,
"alpha_frac": 0.6723996724,
"autogenerated": false,
"ratio": 3.3089430894308944,
"... |
from django.test import TestCase
from curious import model_registry
from curious.query import Query
from curious_tests.models import Blog, Entry, Author, Comment
from curious_tests import assertQueryResultsEqual
import curious_tests.models
class TestSubQueries(TestCase):
def setUp(self):
blog = Blog(name='Datab... | {
"repo_name": "ginkgobioworks/curious",
"path": "tests/curious_tests/test_or_queries.py",
"copies": "2",
"size": "4286",
"license": "mit",
"hash": 6098987555787716000,
"line_mean": 39.4339622642,
"line_max": 111,
"alpha_frac": 0.5718618759,
"autogenerated": false,
"ratio": 3.5392237819983485,
"... |
from django.test import TestCase
from curious.query import Parser
import humanize
class TestParserCore(TestCase):
def test_parsing_model_and_filter(self):
p = Parser('A(1)')
self.assertEquals(p.object_query, {'model': 'A', 'method': None,
'filters': [{'method': 'filte... | {
"repo_name": "ginkgobioworks/curious",
"path": "tests/curious_tests/test_parser.py",
"copies": "2",
"size": "8133",
"license": "mit",
"hash": 1371157772049693000,
"line_mean": 39.2623762376,
"line_max": 97,
"alpha_frac": 0.6103528833,
"autogenerated": false,
"ratio": 3.138942493245851,
"config... |
from django.test import TestCase
from cyborg_identity.identity.models import Identity, IsMatch
import uuid
from django.conf import settings
from django_graph import connection_handler
from rest_framework.test import APIClient
class IdentityAPITest(TestCase):
def _identity_tree(self, identity):
identity1 =... | {
"repo_name": "shawnhermans/cyborg-identity-manager",
"path": "cyborg_identity/identity/tests/test_api.py",
"copies": "1",
"size": "2710",
"license": "mit",
"hash": -5338202749294725000,
"line_mean": 30.511627907,
"line_max": 96,
"alpha_frac": 0.6276752768,
"autogenerated": false,
"ratio": 4.1628... |
from django.test import TestCase
from data_api.models import System, Signal
import django.utils.timezone as tmz
import pytz
import delorean
class TestModel(TestCase):
def setUp(self):
# when creating a System
self.system = System.objects.create(name="a_name")
def test_set_uuid(self):
... | {
"repo_name": "kietdlam/Dator",
"path": "data_api/tests/test_model.py",
"copies": "1",
"size": "2301",
"license": "mit",
"hash": 3034712655400866300,
"line_mean": 33.8787878788,
"line_max": 73,
"alpha_frac": 0.6132116471,
"autogenerated": false,
"ratio": 3.4705882352941178,
"config_test": true,... |
from django.test import TestCase
from datacombine import models as dcmodels
from collections import namedtuple
from django.core.exceptions import FieldError
import re
Match = namedtuple("Match", ["object", "regex", "match"])
class PhoneTestCase(TestCase):
def setUp(self):
dcmodels.Phone.objects.create(a... | {
"repo_name": "Crimson-Star-Software/data-combine",
"path": "datacombine/tests/test_models.py",
"copies": "1",
"size": "3897",
"license": "mit",
"hash": -1721827303593609000,
"line_mean": 35.4205607477,
"line_max": 74,
"alpha_frac": 0.5996920708,
"autogenerated": false,
"ratio": 3.451727192205491... |
from django.test import TestCase
from datetime import date, datetime, timedelta
from restclients.util.date_formator import full_month_date_str
from restclients.util.date_formator import abbr_month_date_time_str
from restclients.util.date_formator import abbr_week_month_day_str
from restclients.util.date_formator import... | {
"repo_name": "jeffFranklin/uw-restclients",
"path": "restclients/test/util/date_formator.py",
"copies": "1",
"size": "15136",
"license": "apache-2.0",
"hash": -784228432615674400,
"line_mean": 46.3,
"line_max": 88,
"alpha_frac": 0.6271141649,
"autogenerated": false,
"ratio": 3.3523809523809525,
... |
from django.test import TestCase
from datetime import date
# Create your tests here.
from enrollment.models import TipoServicio
from enrollment.models import Colegio
from enrollment.models import Servicio
class TipoServicioModelTest(TestCase):
def setUp(self):
self.colegio_test1 = Colegio(nombre = 'Trilc... | {
"repo_name": "furthz/colegio",
"path": "src/enrollment/test_models.py",
"copies": "1",
"size": "5937",
"license": "mit",
"hash": -5394993844744930000,
"line_mean": 52.9727272727,
"line_max": 103,
"alpha_frac": 0.3968334176,
"autogenerated": false,
"ratio": 4.660125588697017,
"config_test": tru... |
#from django.test import TestCase
from datetime import date
from decimal import *
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from rest_framework.test import APITestCase
from rest_framework.authtoken.models import Token
from .models import *
from .mommy_recipes import *
... | {
"repo_name": "ibamacsr/painelmma_api",
"path": "restApp/tests.py",
"copies": "1",
"size": "8630",
"license": "mit",
"hash": -4213830851027695000,
"line_mean": 36.3636363636,
"line_max": 79,
"alpha_frac": 0.6053302433,
"autogenerated": false,
"ratio": 3.2237579379902876,
"config_test": true,
... |
from django.test import TestCase
from datetime import date, timedelta
from uptime.models.journal_models import Equipment, Journal
from uptime.models.report_models import Report
from uptime.constants import STATE_SET
class JournalTestCase(TestCase):
def setUp(self):
eq = Equipment.objects.create(name='Te... | {
"repo_name": "Igelinmist/etools",
"path": "etools/apps/uptime/tests/test_models.py",
"copies": "1",
"size": "15325",
"license": "bsd-3-clause",
"hash": -6171355526500786000,
"line_mean": 37.5532994924,
"line_max": 102,
"alpha_frac": 0.517116524,
"autogenerated": false,
"ratio": 3.199915736254476... |
from django.test import TestCase
from datetime import datetime
from postgres_stats import DateTrunc, Extract
from .models import Checkin
class TestFunctions(TestCase):
def test_date_trunc(self):
_checkin = Checkin.objects.create(logged_at='2015-11-01 11:14:01')
checkin = Checkin.objects. \
... | {
"repo_name": "rtidatascience/django-postgres-stats",
"path": "tests/test_functions.py",
"copies": "1",
"size": "1040",
"license": "bsd-3-clause",
"hash": 5955174800988658000,
"line_mean": 34.8620689655,
"line_max": 74,
"alpha_frac": 0.5894230769,
"autogenerated": false,
"ratio": 3.61111111111111... |
from django.test import TestCase
from datetime import datetime, timedelta
from django.core.urlresolvers import reverse
# Create your tests here.
class Chapter11SessionTests(TestCase):
def test_user_number_of_access_and_last_access_to_index(self):
#Access index page 100 times
for i in xrange(0, 100)... | {
"repo_name": "leifos/tango_with_tests",
"path": "tango_with_django_project/ch11tests/tests.py",
"copies": "1",
"size": "2263",
"license": "mit",
"hash": 3643977810636803000,
"line_mean": 35.5,
"line_max": 111,
"alpha_frac": 0.6425099426,
"autogenerated": false,
"ratio": 4.198515769944342,
"con... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.