text
stringlengths
0
1.05M
meta
dict
from django.test import TestCase from micro_admin.forms import * from micro_admin.models import * from tempfile import NamedTemporaryFile from micro_admin.templatetags import ledgertemplatetags, loans_tags from django.core.urlresolvers import reverse class Modelform_test(TestCase): def setUp(self): self.b...
{ "repo_name": "MicroPyramid/micro-finance", "path": "micro_admin/tests.py", "copies": "2", "size": "53263", "license": "mit", "hash": 7452188064001307000, "line_mean": 46.0937223696, "line_max": 604, "alpha_frac": 0.5988584946, "autogenerated": false, "ratio": 3.6662307268722465, "config_test":...
from django.test import TestCase from mock import MagicMock from ood.models import OodInstance from ood.states import droplet class TestController(object): class TestDroplet(object): status = 'unknown' class TestClient(object): def __init__(self): self.reset_player_info = MagicMo...
{ "repo_name": "markrcote/ood", "path": "tests.py", "copies": "1", "size": "7747", "license": "mit", "hash": -115246687564833250, "line_mean": 38.5255102041, "line_max": 77, "alpha_frac": 0.6687750097, "autogenerated": false, "ratio": 3.8484848484848486, "config_test": true, "has_no_keywords":...
from django.test import TestCase from mock import MagicMock, patch from .export import request_export from .models import Collection, CollectionSet, Seed, Credential, Group, User, Export from .rabbit import RabbitWorker import datetime from tzlocal import get_localzone import iso8601 class ExportTests(TestCase): ...
{ "repo_name": "gwu-libraries/sfm-ui", "path": "sfm/ui/test_export.py", "copies": "2", "size": "4679", "license": "mit", "hash": 7447140599559657000, "line_mean": 52.7816091954, "line_max": 105, "alpha_frac": 0.6133789271, "autogenerated": false, "ratio": 4.111599297012302, "config_test": true, ...
from django.test import TestCase from mock import MagicMock, patch from .. import serializers class ThumbnailField(TestCase): def test_get_generator_kwargs(self): expected = { 'width': 50, 'height': 50, 'anchor': 'tr', 'crop': 1, 'upscale': 1, ...
{ "repo_name": "incuna/django-user-management", "path": "user_management/api/avatar/tests/test_serializers.py", "copies": "1", "size": "4435", "license": "bsd-2-clause", "hash": -7160332519331795000, "line_mean": 32.8549618321, "line_max": 84, "alpha_frac": 0.6004509583, "autogenerated": false, "r...
from django.test import TestCase from mock import Mock, MagicMock, patch from django.test.client import RequestFactory from cache_tools.tools import cache_page_in_group, get_group_key, expire_cache_group, TIME_TO_CACHE class CachingTest(TestCase): def test_get_group_key(self): key = get_group_key('test') ...
{ "repo_name": "cfpb/django-cache-tools", "path": "cache_tools/tests/test_tools.py", "copies": "1", "size": "1601", "license": "cc0-1.0", "hash": 939130248099313700, "line_mean": 36.2558139535, "line_max": 99, "alpha_frac": 0.6527170518, "autogenerated": false, "ratio": 3.465367965367965, "confi...
from django.test import TestCase from mock import Mock from silk.model_factory import RequestModelFactory class TestLongRequestUrl(TestCase): def test_no_long_url(self): url = '1234567890' * 19 # 190-character URL mock_request = Mock() mock_request.META = {'CONTENT_TYPE': 'text/plain'} ...
{ "repo_name": "mtford90/silk", "path": "project/tests/test_config_long_urls.py", "copies": "2", "size": "1043", "license": "mit", "hash": -6008658850411780000, "line_mean": 37.6296296296, "line_max": 83, "alpha_frac": 0.6404602109, "autogenerated": false, "ratio": 3.7517985611510793, "config_te...
from django.test import TestCase from mock import Mock from user import factories, models, middleware class AnonboardUserMiddlewareTest(TestCase): def setUp(self): super(AnonboardUserMiddlewareTest, self).setUp() self.middleware = middleware.AnonboardUserMiddleware() self.u...
{ "repo_name": "anehx/anonboard-backend", "path": "user/tests/test_middleware.py", "copies": "1", "size": "1256", "license": "mit", "hash": 7663560316496594000, "line_mean": 32.9459459459, "line_max": 109, "alpha_frac": 0.6449044586, "autogenerated": false, "ratio": 3.794561933534743, "config_te...
from django.test import TestCase from mock import Mock from .middleware import IGBMiddleware class IGBMiddlewareTest(TestCase): """ Test the IGB Middleware """ def setUp(self): self.im = IGBMiddleware() self.igb_user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 ...
{ "repo_name": "nikdoof/django-eveigb", "path": "eveigb/tests.py", "copies": "1", "size": "5626", "license": "bsd-3-clause", "hash": 7927083369870629000, "line_mean": 40.9850746269, "line_max": 156, "alpha_frac": 0.5686100249, "autogenerated": false, "ratio": 3.3608124253285543, "config_test": t...
from django.test import TestCase from mock import Mock from .utils import BlinkMixin from ..models import WorkerType from ..tasks import poll_worker_types class TestSignals(BlinkMixin, TestCase): def test_worker_online(self): from ..signals import worker_online online_mock = Mock() worke...
{ "repo_name": "smn/blinky", "path": "blinky/core/tests/test_signals.py", "copies": "1", "size": "1292", "license": "bsd-3-clause", "hash": -2874628469995627000, "line_mean": 25.9166666667, "line_max": 46, "alpha_frac": 0.6315789474, "autogenerated": false, "ratio": 4.167741935483871, "config_te...
from django.test import TestCase from mock import Mock, NonCallableMock, NonCallableMagicMock, patch from silk.collector import DataCollector from silk.models import SQLQuery, Request from silk.sql import execute_sql from silk.tests.util import delete_all_models def mock_sql(): mock_sql_query = Mock(spec_set=['_...
{ "repo_name": "vandersonmota/silk", "path": "silk/tests/test_execute_sql.py", "copies": "1", "size": "2886", "license": "mit", "hash": 1004719350027058800, "line_mean": 32.5581395349, "line_max": 92, "alpha_frac": 0.6365211365, "autogenerated": false, "ratio": 3.772549019607843, "config_test": ...
from django.test import TestCase from mock import Mock, patch from ct.sourcedb_plugin.wikipedia_plugin import LessonDoc import wikipedia @patch('ct.sourcedb_plugin.wikipedia_plugin.wikipedia') class LessonDocTest(TestCase): """ Tests for wikipedia plugin. """ def test_init(self, wiki_mocked): ...
{ "repo_name": "derdmitry/socraticqs2", "path": "mysite/ct/tests/plugins.py", "copies": "2", "size": "1869", "license": "apache-2.0", "hash": -3988386727554371000, "line_mean": 37.9375, "line_max": 116, "alpha_frac": 0.6639914393, "autogenerated": false, "ratio": 3.6863905325443787, "config_test...
from django.test import TestCase from mock import NonCallableMock from silk.collector import DataCollector from silk.middleware import SilkyMiddleware from .util import delete_all_models from silk.config import SilkyConfig from silk.models import Request def fake_get_response(): def fake_response(): retu...
{ "repo_name": "mtford90/silk", "path": "project/tests/test_config_meta.py", "copies": "2", "size": "1493", "license": "mit", "hash": -3919833350683570000, "line_mean": 30.1041666667, "line_max": 74, "alpha_frac": 0.6416610851, "autogenerated": false, "ratio": 4.079234972677596, "config_test": t...
from django.test import TestCase from mock import patch, MagicMock from datetime import date, timedelta from physical.tests import factory as factory_physical from physical.models import Instance from logical.tests import factory as factory_logical from dbaas.tests.helpers import InstanceHelper from notification.tasks...
{ "repo_name": "globocom/database-as-a-service", "path": "dbaas/notification/tests/test_periodic_tasks.py", "copies": "1", "size": "6547", "license": "bsd-3-clause", "hash": 5645001577963344000, "line_mean": 38.4397590361, "line_max": 82, "alpha_frac": 0.6564838857, "autogenerated": false, "ratio"...
from django.test import TestCase from mock import patch, MagicMock from requests.exceptions import SSLError from ona import OnaApiClient from ona.api import OnaApiClientException class TestClientRequest(TestCase): def test_ssl_error(self): client = OnaApiClient('example.com', '2384729347234') with...
{ "repo_name": "stbenjam/CTS", "path": "ona/tests/test_api.py", "copies": "2", "size": "2765", "license": "bsd-3-clause", "hash": -5684044997881210000, "line_mean": 40.2686567164, "line_max": 93, "alpha_frac": 0.6184448463, "autogenerated": false, "ratio": 4.3203125, "config_test": true, "has_...
from django.test import TestCase from mock import patch, MagicMock from corehq.apps.export.models import FormExportInstance, CaseExportInstance from corehq.apps.reports.tasks import saved_exports class TestDailySavedExports(TestCase): @classmethod def setUpClass(cls): cls.exports = [ For...
{ "repo_name": "qedsoftware/commcare-hq", "path": "corehq/apps/export/tests/test_daily_saved_exports.py", "copies": "1", "size": "1113", "license": "bsd-3-clause", "hash": -1755670051353665500, "line_mean": 28.2894736842, "line_max": 80, "alpha_frac": 0.6307277628, "autogenerated": false, "ratio":...
from django.test import TestCase from mock import patch, Mock import six import silk from silk.models import Request from silk.profiling.dynamic import _get_module, _get_parent_module, profile_function_or_method class TestGetModule(TestCase): """test for _get_module""" def test_singular(self): modul...
{ "repo_name": "CloudNcodeInc/silk", "path": "tests/tests/test_dynamic_profiling.py", "copies": "1", "size": "3366", "license": "mit", "hash": 747460793374293900, "line_mean": 33.7010309278, "line_max": 120, "alpha_frac": 0.6013071895, "autogenerated": false, "ratio": 3.9185098952270083, "config...
from django.test import TestCase from mock import patch, Mock from silk.config import SilkyConfig from silk.middleware import SilkyMiddleware from silk.models import Request class TestApplyDynamicMappings(TestCase): def test_dynamic_decorator(self): middleware = SilkyMiddleware() SilkyConfig().SI...
{ "repo_name": "vandersonmota/silk", "path": "silk/tests/test_silky_middleware.py", "copies": "1", "size": "3242", "license": "mit", "hash": 6089760745030874000, "line_mean": 32.7708333333, "line_max": 101, "alpha_frac": 0.5795805059, "autogenerated": false, "ratio": 4.114213197969543, "config_t...
from django.test import TestCase from mock import patch from kolibri.core.tasks.decorators import register_task from kolibri.core.tasks.job import JobRegistry from kolibri.core.tasks.job import RegisteredJob from kolibri.core.tasks.utils import stringify_func class TestTaskDecorators(TestCase): def setUp(self): ...
{ "repo_name": "learningequality/kolibri", "path": "kolibri/core/tasks/test/test_decorators.py", "copies": "1", "size": "2516", "license": "mit", "hash": -8475723945358780000, "line_mean": 29.313253012, "line_max": 84, "alpha_frac": 0.6077106518, "autogenerated": false, "ratio": 4, "config_test"...
from django.test import TestCase from mock import patch from fortumo import consts from fortumo.models import Service, Payment, Message from fortumo.utils import ( calculate_signature, generate_pin, generate_unique_pin, signature_is_valid, ) class SignatureTestCase(TestCase): def setUp(self): ...
{ "repo_name": "v0y/django-fortumo", "path": "fortumo/tests/test_utils.py", "copies": "1", "size": "2874", "license": "mit", "hash": -1170484919846266400, "line_mean": 29.2526315789, "line_max": 74, "alpha_frac": 0.5626304802, "autogenerated": false, "ratio": 3.6379746835443036, "config_test": t...
from django.test import TestCase from mockldap import MockLdap from ..ldap.actions import LDAPAccountAdder from ..ldap.actions import LDAPAccountUpdater from ..ldap import utils from ..models import PendingUser class LDAPFunctionsTestCase(TestCase): """ Warning : you must update your project settings in orde...
{ "repo_name": "Atilla106/members.atilla.org", "path": "accounts/tests/test_ldap_functions.py", "copies": "1", "size": "3480", "license": "mit", "hash": -8354511628666242000, "line_mean": 31.523364486, "line_max": 86, "alpha_frac": 0.5482758621, "autogenerated": false, "ratio": 4.041811846689895, ...
from django.test import TestCase from model_mommy import mommy from hamcrest import * class TestBoardModel(TestCase): def setUp(self): self.project = mommy.make('projects.Project') self.project2 = mommy.make('projects.Project') def test_board_counter_with_one_board(self): new_board = ...
{ "repo_name": "krkmetal/djangodash2013", "path": "tests/apps/projects/test_models.py", "copies": "1", "size": "3336", "license": "mit", "hash": -1256413614362502100, "line_mean": 43.4933333333, "line_max": 85, "alpha_frac": 0.670263789, "autogenerated": false, "ratio": 3.518987341772152, "confi...
from api.requests import PublicPostsRequestFactory # import requests # class PublicPostRequestTestCases(TestCase): # """ # Tests related to Public Post Requests # """ # def setUp(self): # # Create Node # self.node1 = mommy.make(Node, host='test', password='test') # # Create Au...
{ "repo_name": "Roshack/cmput410-project", "path": "DistributedSocialNetworking/api/tests/test_requests.py", "copies": "2", "size": "1794", "license": "apache-2.0", "hash": 1460808255279201300, "line_mean": 37.170212766, "line_max": 91, "alpha_frac": 0.615942029, "autogenerated": false, "ratio": 3...
from django.test import TestCase from model_mommy import mommy from monitor.api.serializers import TwitterUserSerializer, UsernameSerializer from monitor.tests.utils.api_mock import RequestMock import mock class TestTwitterUserSerializer(TestCase): def setUp(self): self.user = mommy.make('users.User') ...
{ "repo_name": "arineto/twitter_monitor", "path": "monitor/tests/test_serializers/test_twitter_user_serializers.py", "copies": "1", "size": "1484", "license": "mit", "hash": 8602589827203985000, "line_mean": 33.511627907, "line_max": 77, "alpha_frac": 0.6664420485, "autogenerated": false, "ratio":...
from django.test import TestCase from model_mommy import mommy from songs.forms import InterpretationForm from songs.models import Interpretation class InterpretationFormTestCase(TestCase): @classmethod def setUpClass(cls): cls.user = mommy.make('auth.user', username='test') cls.song = mommy....
{ "repo_name": "romulojales/to-be-musician", "path": "to_be_a_musician/songs/tests/test_forms.py", "copies": "1", "size": "1553", "license": "apache-2.0", "hash": 5869312722714862000, "line_mean": 32.7608695652, "line_max": 71, "alpha_frac": 0.6361880232, "autogenerated": false, "ratio": 3.8063725...
from django.test import TestCase from model_mommy import mommy from common import models from common.tests import ModelReprMixin class TestModelRepr(ModelReprMixin, TestCase): def test_abstract(self): with self.assertRaises(NotImplementedError): models.AbstractBase().__str__() with ...
{ "repo_name": "MasterFacilityList/mfl_api", "path": "common/tests/test_model_repr.py", "copies": "1", "size": "3617", "license": "mit", "hash": -222329856769031330, "line_mean": 31.5855855856, "line_max": 78, "alpha_frac": 0.5941387891, "autogenerated": false, "ratio": 3.4812319538017324, "conf...
from django.test import TestCase from model_mommy import mommy from .models import LeadSource, Lead class LeadSourceTest(TestCase): def test_str_name(self): # Arrange lead_source = mommy.make( LeadSource, name='Downtown billboard', incoming_number='+1555555555...
{ "repo_name": "TwilioDevEd/call-tracking-django", "path": "call_tracking/test_models.py", "copies": "1", "size": "2949", "license": "mit", "hash": -6684678065044241000, "line_mean": 27.0857142857, "line_max": 83, "alpha_frac": 0.517463547, "autogenerated": false, "ratio": 3.8853754940711465, "c...
from django.test import TestCase from ..models import Article, DraftTranslation, PublishedTranslation from main.tests.factories import UserFactory from .factories import ArticleFactory, TranslationFactory from langs.models import Language from main.models import User from django.db.models import F class TranslationTe...
{ "repo_name": "firemark/yellowjuice", "path": "articles/tests/tests.py", "copies": "1", "size": "2279", "license": "mit", "hash": 8298439126912311000, "line_mean": 36.3606557377, "line_max": 78, "alpha_frac": 0.610355419, "autogenerated": false, "ratio": 4.433852140077821, "config_test": true, ...
from django.test import TestCase from models import Article, Publication class ManyToManyTests(TestCase): def setUp(self): # Create a couple of Publications. self.p1 = Publication.objects.create(id=None, title='The Python Journal') self.p2 = Publication.objects.create(id=None, title='Scien...
{ "repo_name": "wbc2010/django1.2.5", "path": "django1.2.5/tests/modeltests/many_to_many/tests.py", "copies": "92", "size": "17756", "license": "bsd-3-clause", "hash": -1973254354894695200, "line_mean": 45.2395833333, "line_max": 113, "alpha_frac": 0.5666253661, "autogenerated": false, "ratio": 4....
from django.test import TestCase from .models import Backtest from rest_framework.test import APIClient from rest_framework import status from django.core.urlresolvers import reverse from django.contrib.auth.models import User # Create your tests here. class ModelTestCase(TestCase): """This class defines the tes...
{ "repo_name": "StepsTeam/mastermind", "path": "djmm/api/tests.py", "copies": "1", "size": "5829", "license": "mit", "hash": 2605569714098199600, "line_mean": 34.5426829268, "line_max": 76, "alpha_frac": 0.6138274147, "autogenerated": false, "ratio": 3.782608695652174, "config_test": true, "ha...
from django.test import TestCase from .models import Blog, GuestbookComment from django.utils import timezone from django.core.urlresolvers import reverse import datetime def create_blogpost(entry, slug, days): """ creates a blog post with post and slug published given number of days offset to now (negati...
{ "repo_name": "LMLohse/corazon", "path": "blog/tests.py", "copies": "1", "size": "2628", "license": "mit", "hash": -6198296767330864000, "line_mean": 38.223880597, "line_max": 118, "alpha_frac": 0.6419330289, "autogenerated": false, "ratio": 3.9697885196374623, "config_test": true, "has_no_ke...
from django.test import TestCase from models import Cart, Item from django.contrib.auth.models import User import datetime from decimal import Decimal class CartAndItemModelsTestCase(TestCase): def _create_cart_in_database(self, creation_date=datetime.datetime.now(), checked_out=False): """ ...
{ "repo_name": "willmurnane/store", "path": "cart/cart/tests.py", "copies": "2", "size": "4226", "license": "bsd-3-clause", "hash": -7892980037879509000, "line_mean": 37.4181818182, "line_max": 119, "alpha_frac": 0.613582584, "autogenerated": false, "ratio": 4.130987292277615, "config_test": tru...
from django.test import TestCase from .models import Category class CategoryTestCase(TestCase): def setUp(self): print("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++") print("Database [ Category ]") Category.objects.create(categoryID=1,categoryName="Development") ...
{ "repo_name": "PNNutkung/Coursing-Field", "path": "mainmodels/tests.py", "copies": "1", "size": "6438", "license": "apache-2.0", "hash": -1664213819422977500, "line_mean": 52.65, "line_max": 87, "alpha_frac": 0.4158123641, "autogenerated": false, "ratio": 4.833333333333333, "config_test": true,...
from django.test import TestCase from models import check_achievement_class class AchievementClassesCheckTest(TestCase): def test_check_achievement_class(self): class AchievementDef(object): name = "Username achivement" key = "username" description = "Handles when a us...
{ "repo_name": "ogirardot/django-achievements", "path": "achievements/tests/achievements.py", "copies": "1", "size": "1264", "license": "bsd-3-clause", "hash": 3315924594053333500, "line_mean": 30.6, "line_max": 95, "alpha_frac": 0.5759493671, "autogenerated": false, "ratio": 4.419580419580419, ...
from django.test import TestCase from .models import Entry from django.contrib.auth import get_user_model from .forms import CommentForm from .models import Entry, Comment from django_webtest import WebTest from django.template import Template, Context from django.template.defaultfilters import slugify import datetime ...
{ "repo_name": "claude-lee/MyBlog", "path": "blog/tests.py", "copies": "1", "size": "6120", "license": "mit", "hash": 3158165939920324600, "line_mean": 33.7727272727, "line_max": 122, "alpha_frac": 0.6475490196, "autogenerated": false, "ratio": 3.675675675675676, "config_test": true, "has_no_k...
from django.test import TestCase from .models import ( Country, City, Venue, EventType, Event, ) class CheckModelsTestCase(TestCase): def setUp(self): self.country = Country.objects.create( id=1, name='Ukraine', code='UA', description='EastEurop', currency...
{ "repo_name": "hotsyk/uapython2", "path": "event/tests.py", "copies": "1", "size": "1668", "license": "bsd-3-clause", "hash": 5391132582489545000, "line_mean": 33.0408163265, "line_max": 77, "alpha_frac": 0.6276978417, "autogenerated": false, "ratio": 3.177142857142857, "config_test": false, ...
from django.test import TestCase from models import * from dateutil.rrule import * import json # Create your tests here. class TestEvents(TestCase): fixtures = ['django_calendar_events/calendar_events/fixtures.json'] def setUp(self): pass def test_event_to_fullcalendar(self): e = Event.obj...
{ "repo_name": "alexkyllo/django-calendar-events", "path": "calendar_events/tests.py", "copies": "1", "size": "1512", "license": "apache-2.0", "hash": -2476347445032746000, "line_mean": 43.4705882353, "line_max": 200, "alpha_frac": 0.6541005291, "autogenerated": false, "ratio": 3.2586206896551726,...
from django.test import TestCase from ..models import * from ..tests.factory import * from django.test.client import Client from ..views.api import * # funzt bisher alles class GroupTest(TestCase): def test_serializeAll(self): # ================================================================= # t...
{ "repo_name": "floatec/ProsDataBase", "path": "ProsDataBase/database/tests/grouptest.py", "copies": "1", "size": "3530", "license": "bsd-2-clause", "hash": -1643750423225071600, "line_mean": 41.5301204819, "line_max": 85, "alpha_frac": 0.4362606232, "autogenerated": false, "ratio": 5.711974110032...
from django.test import TestCase from . models import * from www.settings import TIME_ZONE class Dummy(AbstractAuditModel): current_revision = models.ForeignKey('DummyRevision', null=True, default=None) immutable_field = models.CharField(max_length=100) class DummyRevision(AbstractRevision): tracked_mod...
{ "repo_name": "sheanmassey/django-audit-trails", "path": "django_audit/tests.py", "copies": "1", "size": "1845", "license": "unlicense", "hash": -4667037803153168000, "line_mean": 31.9464285714, "line_max": 97, "alpha_frac": 0.633604336, "autogenerated": false, "ratio": 3.697394789579158, "conf...
from django.test import TestCase from .models import * # Create your tests here. class PortfolioTest(TestCase): def setUp(self): Portfolio() def test_portfolio_to_str(self): port = Portfolio() port.name = "Women's Fund" name = Portfolio.__str__(port) self.assertEqual(...
{ "repo_name": "kylebegovich/ICIdo", "path": "mainsite/tests.py", "copies": "1", "size": "3256", "license": "mit", "hash": 7655273397227079000, "line_mean": 30.6213592233, "line_max": 110, "alpha_frac": 0.5764742015, "autogenerated": false, "ratio": 3.5701754385964914, "config_test": true, "ha...
from django.test import TestCase from .models import Oficio, Sacramento class TestLoadOficios(TestCase): """ Unit test suite for testing that initial data of periodos is created """ def test_oficios_created(self): """ Checks that all the original oficios where loaded correctly. """ ...
{ "repo_name": "erikiado/jp2_online", "path": "familias/test_migrations.py", "copies": "1", "size": "2168", "license": "mit", "hash": 8155259883020301000, "line_mean": 43.1224489796, "line_max": 76, "alpha_frac": 0.6956521739, "autogenerated": false, "ratio": 3.315950920245399, "config_test": tr...
from django.test import TestCase from .models import Person from django.contrib.auth.models import User from .models import handle_uploaded_file ''' Author: TeamD-MoisesIsLateAgain Date: 2/20/2017 tests.py File containing all the test related functions for the tests. Tests uplading a person and file aswell as uploadin...
{ "repo_name": "moiseslorap/RIT", "path": "Intro to Software Engineering/Release 2/HealthNet/HealthNetApp/tests.py", "copies": "1", "size": "2238", "license": "mit", "hash": -4621509519360815000, "line_mean": 36.3, "line_max": 84, "alpha_frac": 0.563896336, "autogenerated": false, "ratio": 3.99642...
from django.test import TestCase from ..models import Process, Task from ..signals import extract_arguments, recursive_lookup import json class ProcessSignalTestCase(TestCase): def setUp(self): payload = '{"message": "testing"}' self.process = Process.objects.create( proces...
{ "repo_name": "toast38coza/DJProcess", "path": "process/tests/test_signals.py", "copies": "1", "size": "2716", "license": "mit", "hash": -2491251426958762000, "line_mean": 32.95, "line_max": 98, "alpha_frac": 0.6075110457, "autogenerated": false, "ratio": 3.852482269503546, "config_test": true,...
from django.test import TestCase from .models import Region, Service class MiddlewareTests(TestCase): @classmethod def setUpTestData(cls): cls.north = Region.objects.create(pk='N', name='North') cls.service = Service.objects.create( pk='ea_21-45-A-y08', line_name='45A',...
{ "repo_name": "stev-0/bustimes.org.uk", "path": "busstops/test_middleware.py", "copies": "1", "size": "1144", "license": "mpl-2.0", "hash": 8190720502225323000, "line_mean": 33.6666666667, "line_max": 80, "alpha_frac": 0.618006993, "autogenerated": false, "ratio": 3.3255813953488373, "config_te...
from django.test import TestCase from .models import Spell class SpellModelTest(TestCase): fixtures = ['srd.json'] def test_absolute_url(self): """Checks that get_absolute_url produces an URL that works""" spell = Spell.objects.get(id=1) url = spell.get_absolute_url() response ...
{ "repo_name": "machinalis/django-srd20", "path": "srd20/tests.py", "copies": "1", "size": "1027", "license": "bsd-3-clause", "hash": -2265396911304708000, "line_mean": 33.2333333333, "line_max": 87, "alpha_frac": 0.6416747809, "autogenerated": false, "ratio": 3.4233333333333333, "config_test": ...
from django.test import TestCase from .models import TemporarySaleModel class SimplePosLoadingTests(TestCase): def test_that_pos_page_200(self): response = self.client.get('/pos/') self.assertEqual(response.status_code, 200) class ActualSales(TestCase): ''' this is just to int...
{ "repo_name": "SlashRoot/WHAT", "path": "what_apps/pos/tests.py", "copies": "1", "size": "1084", "license": "mit", "hash": -8272749390269113000, "line_mean": 34, "line_max": 112, "alpha_frac": 0.5747232472, "autogenerated": false, "ratio": 4.234375, "config_test": true, "has_no_keywords": fal...
from django.test import TestCase from ..models import TicketType from ..forms import TicketsForm from .utilities import mkTicketType #class TicketFormTest(TestCase): # """ # Tests the TicketForm # """ # def testFormOffersOnlyAvailableTicketTypes(self): # """ # Test that the choices for the ti...
{ "repo_name": "gdetrez/fscons-ticketshop", "path": "ticketshop/ticketapp/tests/test_forms.py", "copies": "1", "size": "1941", "license": "mit", "hash": -4778334845694416000, "line_mean": 34.2909090909, "line_max": 82, "alpha_frac": 0.6223596084, "autogenerated": false, "ratio": 3.5355191256830603...
from django.test import TestCase from models.Post import Post from mock import MagicMock, Mock import markdown from models.Author import Author from models.Comment import Comment from unittest import skip from django.contrib.auth.models import User class PostModelTests(TestCase): def setUp(self): superuse...
{ "repo_name": "CMPUT404Team/CMPUT404-project-socialdistribution", "path": "cmput404project/service/testPostModel.py", "copies": "1", "size": "3823", "license": "apache-2.0", "hash": 7465966809939587000, "line_mean": 37.23, "line_max": 100, "alpha_frac": 0.648182056, "autogenerated": false, "ratio...
from django.test import TestCase from modeltests.model_inheritance.models import Title class InheritanceSameModelNameTests(TestCase): def setUp(self): # The Title model has distinct accessors for both # model_inheritance.Copy and model_inheritance_same_model_name.Copy # models. sel...
{ "repo_name": "faun/django_test", "path": "tests/modeltests/model_inheritance_same_model_name/tests.py", "copies": "54", "size": "1510", "license": "bsd-3-clause", "hash": -802954879353397900, "line_mean": 46.1875, "line_max": 97, "alpha_frac": 0.6582781457, "autogenerated": false, "ratio": 4.037...
from django.test import TestCase from ModelTests.models import * class ModelDummyTests(TestCase): def setUp(self): questions = ["A. how are you doing", "C what day is today", "B what's happending"] for q in questions: q1 = Question(text=q) q1.save() answers = ["goo...
{ "repo_name": "liuyonggg/learning_python", "path": "Dummytests/ModelTests/tests.py", "copies": "1", "size": "8643", "license": "mit", "hash": 2746121965213448700, "line_mean": 36.7423580786, "line_max": 214, "alpha_frac": 0.5728335069, "autogenerated": false, "ratio": 3.1589912280701755, "confi...
from django.test import TestCase from moneyed import Money from .. import api, models, enums, exceptions from . import factories class WalletTest(TestCase): def test_get_wallet(self): wallet_obj = factories.WalletFactory.create() item_obj = api.get_wallet(wallet_obj.owner_id, wallet_obj.currency) ...
{ "repo_name": "uppsaladatavetare/foobar-api", "path": "src/wallet/tests/test_api.py", "copies": "1", "size": "15672", "license": "mit", "hash": 7805813649152486000, "line_mean": 43.5227272727, "line_max": 79, "alpha_frac": 0.6315722307, "autogenerated": false, "ratio": 3.5569677712210623, "conf...
from django.test import TestCase from moneyed import Money from .. import enums, models from .factories import WalletFactory, WalletTrxFactory class TransactionManagerTests(TestCase): def test_compute_balances(self): wallet_obj = WalletFactory.create() wallet_obj1 = WalletFactory.create() ...
{ "repo_name": "uppsaladatavetare/foobar-api", "path": "src/wallet/tests/test_manager.py", "copies": "1", "size": "4217", "license": "mit", "hash": -4880065178726527000, "line_mean": 36.6517857143, "line_max": 74, "alpha_frac": 0.6229547071, "autogenerated": false, "ratio": 3.5259197324414715, "...
from django.test import TestCase from mongoengine import Document, fields from rest_framework.compat import unicode_repr from rest_framework_mongoengine.fields import GeoJSONField, GeoPointField from rest_framework_mongoengine.serializers import DocumentSerializer from .utils import FieldTest, dedent class TestGeoP...
{ "repo_name": "BurkovBA/django-rest-framework-mongoengine", "path": "tests/test_geo.py", "copies": "1", "size": "8176", "license": "mit", "hash": 197281573453673020, "line_mean": 46.8128654971, "line_max": 158, "alpha_frac": 0.522260274, "autogenerated": false, "ratio": 2.773405698778833, "conf...
from django.test import TestCase from mongoengine import ValidationError as me_ValidationError from mongoengine import Document, fields from rest_framework import serializers from rest_framework_mongoengine.serializers import DocumentSerializer # How "id" works in mongoengine # ----------------------------- # # In m...
{ "repo_name": "umutbozkurt/django-rest-framework-mongoengine", "path": "tests/test_id.py", "copies": "2", "size": "2804", "license": "mit", "hash": 6845417573641255000, "line_mean": 31.9882352941, "line_max": 78, "alpha_frac": 0.6918687589, "autogenerated": false, "ratio": 4.1540740740740745, "...
from django.test import TestCase from multilingual.flatpages.models import MultilingualFlatPage from multilingual.utils import GLL from multilingual import languages from django.utils.translation import activate class CoreTestCase(TestCase): fixtures = ['testdata.json'] def test_01_read(self): mfp...
{ "repo_name": "ojii/django-multilingual-ng", "path": "tests/testproject/tests/core.py", "copies": "1", "size": "2565", "license": "mit", "hash": -8729007045700485000, "line_mean": 40.3870967742, "line_max": 75, "alpha_frac": 0.6452241715, "autogenerated": false, "ratio": 3.3705650459921155, "co...
from django.test import TestCase from myblogapp.models import Post, Tag from django.core.urlresolvers import reverse class PostTestCase(TestCase): # models test def setUp(self): Post.objects.create(title="R. Feynman and QED", body="It's just revolutionary") def get_post(self, title="R. Feynman an...
{ "repo_name": "TomGijselinck/mywebsite", "path": "myblogapp/tests.py", "copies": "1", "size": "2577", "license": "mit", "hash": 1571695945651834600, "line_mean": 34.7916666667, "line_max": 90, "alpha_frac": 0.6608459449, "autogenerated": false, "ratio": 3.6605113636363638, "config_test": true, ...
from django.test import TestCase from myfavteam.models import * from myfavteam.views import * import datetime import copy from django.http import Http404 test_team1 = {'name' : 'MyFavTestTeam' , 'short_name' : 'TestTeam' , 'my_team' : True , 'le...
{ "repo_name": "juanc27/myfavteam", "path": "myfavteam/tests.py", "copies": "1", "size": "9340", "license": "mit", "hash": 349905472891891140, "line_mean": 30.768707483, "line_max": 75, "alpha_frac": 0.5633832976, "autogenerated": false, "ratio": 3.603395061728395, "config_test": true, "has_no...
from django.test import TestCase from myproject.core.forms import PersonForm, AddressForm, ProductForm class PersonFormTest(TestCase): # def test_cpf_is_digit(self): # 'CPF must only accept digits.' # form = self.make_validated_form(cpf='ABCD0000000') # self.assertItemsEqual(['cpf'], form...
{ "repo_name": "rg3915/django-example", "path": "myproject/core/tests/test_forms.py", "copies": "1", "size": "2201", "license": "mit", "hash": 2434406115380560400, "line_mean": 26.5, "line_max": 69, "alpha_frac": 0.5313636364, "autogenerated": false, "ratio": 3.660565723793677, "config_test": tr...
from django.test import TestCase from myuw.dao.notice import _get_notices_by_regid FDAO_SWS = 'restclients.dao_implementation.sws.File' FDAO_PWS = 'restclients.dao_implementation.pws.File' class TestNotices(TestCase): def test_get_notice_by_regid(self): with self.settings(RESTCLIENTS_SWS_DAO_CLASS=FDAO...
{ "repo_name": "fanglinfang/myuw", "path": "myuw/test/dao/notice.py", "copies": "1", "size": "8130", "license": "apache-2.0", "hash": -4305338801544140300, "line_mean": 44.9322033898, "line_max": 79, "alpha_frac": 0.5108241082, "autogenerated": false, "ratio": 4.593220338983051, "config_test": f...
from django.test import TestCase from myuw.dao.schedule import _get_schedule from restclients.models import Term from myuw.dao.textbook import get_textbook_by_schedule from myuw.dao.textbook import get_verba_link_by_schedule class TestTextbooks(TestCase): def test_get_by_schedule(self): regid = "9136CCB8F...
{ "repo_name": "fanglinfang/myuw", "path": "myuw/test/dao/textbook.py", "copies": "1", "size": "1308", "license": "apache-2.0", "hash": 8308851075955370000, "line_mean": 36.3714285714, "line_max": 64, "alpha_frac": 0.6536697248, "autogenerated": false, "ratio": 3.40625, "config_test": true, "h...
from django.test import TestCase from nanolog.models import Nanolog from nanolog.utils import nanolog from django.contrib.auth.models import User class SimpleTest(TestCase): def setUp(self): self.user = User.objects.create_user( username='test', email='test@test', password='test') d...
{ "repo_name": "DNX/django-nanolog", "path": "nanolog/tests.py", "copies": "1", "size": "4063", "license": "bsd-3-clause", "hash": 6482079972895396000, "line_mean": 45.1704545455, "line_max": 126, "alpha_frac": 0.6411518582, "autogenerated": false, "ratio": 3.352310231023102, "config_test": true...
from django.test import TestCase from nippou_app.models import Task, nippou_data, User """"""""""""""""""""" 以下、モデル検証用単体テスト """"""""""""""""""""" def create_user(): return User.objects.create() def create_task(): return Task.objects.create() def create_nippou(): return nippou_data.objects.create() clas...
{ "repo_name": "ykoga-kyutech/nippou_proj", "path": "nippou_app/tests.py", "copies": "1", "size": "10891", "license": "mit", "hash": 4651761706074065000, "line_mean": 33.7483870968, "line_max": 140, "alpha_frac": 0.6346671618, "autogenerated": false, "ratio": 3.1951943043607236, "config_test": t...
from django.test import TestCase from nose.tools import assert_equals, assert_not_equals from api.models import ShowIf from utils import factories import json class ShowIfTest(TestCase): def test_create_showif(self): page = factories.PageFactory() element = factories.ElementFactory() cond...
{ "repo_name": "SanaMobile/sana.protocol_builder", "path": "src-django/api/tests/test_model_show_if.py", "copies": "1", "size": "1282", "license": "bsd-3-clause", "hash": 7902908576483773000, "line_mean": 31.05, "line_max": 63, "alpha_frac": 0.4602184087, "autogenerated": false, "ratio": 4.7481481...
from django.test import TestCase from nose.tools import istest from merendeira.supplies.models import Category, Product class CategoryViewTest(TestCase): @istest def lists_categories(self): category1 = Category.objects.create(title='Comidas') category2 = Category.objects.create(title='Bebidas...
{ "repo_name": "diogobaeder/merendeira", "path": "tests/supplies/test_views.py", "copies": "1", "size": "1228", "license": "bsd-2-clause", "hash": -2332153575812139000, "line_mean": 31.3157894737, "line_max": 76, "alpha_frac": 0.7068403909, "autogenerated": false, "ratio": 3.910828025477707, "co...
from django.test import TestCase from nose.tools import * from ..models import Criterion, Rating, Place, SurveySession class RatingModelTest (TestCase): def setUp(self): super(RatingModelTest, self).setUp() Place.objects.all().delete() Rating.objects.all().delete() Criterion.obje...
{ "repo_name": "openplans/streetscore", "path": "street_score/project/test/test_models.py", "copies": "1", "size": "1658", "license": "mit", "hash": -5302898338318292000, "line_mean": 40.45, "line_max": 100, "alpha_frac": 0.6495778046, "autogenerated": false, "ratio": 3.565591397849462, "config_...
from django.test import TestCase from oembed.core import replace class OEmbedTests(TestCase): noembed = r"This is text that should not match any regex." end = r"There is this great video at %s" start = r"%s is a video that I like." middle = r"There is a movie here: %s and I really like it." trailin...
{ "repo_name": "JordanReiter/django-oembed", "path": "oembed/tests.py", "copies": "1", "size": "4453", "license": "bsd-3-clause", "hash": -3394062039382646300, "line_mean": 49.6136363636, "line_max": 106, "alpha_frac": 0.6045362677, "autogenerated": false, "ratio": 2.939273927392739, "config_tes...
from django.test import TestCase from oembed.core import replace class OEmbedTests(TestCase): noembed = ur"This is text that should not match any regex." end = ur"There is this great video at %s" start = ur"%s is a video that I like." middle = ur"There is a movie here: %s and I really like it." tra...
{ "repo_name": "jezdez-archive/django-oembed", "path": "oembed/tests.py", "copies": "1", "size": "4543", "license": "bsd-3-clause", "hash": 5042596019433630000, "line_mean": 50.0561797753, "line_max": 107, "alpha_frac": 0.607748184, "autogenerated": false, "ratio": 2.8862770012706482, "config_te...
from django.test import TestCase from omblog.models import Post class CustomFilterTestCases(TestCase): def setUp(self): """setup stuff""" def tearDown(self): """teardown stuff""" def test_video_tag(self): """The video tag allows a html5 video tag to be outputted using {%...
{ "repo_name": "dubu/python_temp", "path": "omblog/tests/test_customfilters.py", "copies": "2", "size": "1307", "license": "bsd-3-clause", "hash": 1480866987359932000, "line_mean": 35.3055555556, "line_max": 78, "alpha_frac": 0.6419280796, "autogenerated": false, "ratio": 3.2034313725490198, "co...
from django.test import TestCase from ometa.runtime import ParseError from core.search.compiler.invdsl import make_debug_compiler class T(TestCase): def setUp(self): self.test_g = make_debug_compiler() def parse(self, input_): return getattr(self.test_g(input_), self.rule)() def fail(se...
{ "repo_name": "rtucker-mozilla/inventory", "path": "core/search/tests/test_parser.py", "copies": "2", "size": "6893", "license": "bsd-3-clause", "hash": -6138259236095927000, "line_mean": 23.9746376812, "line_max": 106, "alpha_frac": 0.4849847672, "autogenerated": false, "ratio": 3.05811889973380...
from django.test import TestCase from ordered_model.tests.models import Item class ModelTestCase(TestCase): fixtures = ['test_items.json'] def assertNames(self, names): self.assertEqual(names, [i.name for i in Item.objects.all()]) def test_inserting_new_models(self): Item.objects....
{ "repo_name": "andresriancho/django-ordered-model", "path": "ordered_model/tests/tests.py", "copies": "1", "size": "1285", "license": "bsd-3-clause", "hash": 7017092967440932000, "line_mean": 31.9487179487, "line_max": 69, "alpha_frac": 0.5478599222, "autogenerated": false, "ratio": 3.08153477218...
from django.test import TestCase from pages.cache import cache from pages.models import Page, Content from pages import settings as pages_settings from pages.testproj import test_settings from django.conf import settings from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse from dj...
{ "repo_name": "remik/django-page-cms", "path": "pages/tests/testcase.py", "copies": "1", "size": "4588", "license": "bsd-3-clause", "hash": 4111104287406089700, "line_mean": 34.0229007634, "line_max": 112, "alpha_frac": 0.6224934612, "autogenerated": false, "ratio": 3.9620034542314335, "config_...
from django.test import TestCase from pages.models import Page, Content from pages import settings as pages_settings from pages.testproj import test_settings from django.conf import settings from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.template import TemplateDoes...
{ "repo_name": "oliciv/django-page-cms", "path": "pages/tests/testcase.py", "copies": "1", "size": "4140", "license": "bsd-3-clause", "hash": 7992168097800133000, "line_mean": 32.3951612903, "line_max": 77, "alpha_frac": 0.6258454106, "autogenerated": false, "ratio": 3.9731285988483687, "config_...
from django.test import TestCase from pages.models import Page, Content, PageAlias from django.test.client import Client class TestCase(TestCase): """Django page CMS test suite class""" fixtures = ['tests.json'] counter = 1 def get_new_page_data(self, draft=False): """Helper method for creatin...
{ "repo_name": "pombreda/django-page-cms", "path": "pages/tests/testcase.py", "copies": "5", "size": "1240", "license": "bsd-3-clause", "hash": -696193564771575300, "line_mean": 40.3666666667, "line_max": 75, "alpha_frac": 0.6201612903, "autogenerated": false, "ratio": 3.875, "config_test": true...
from django.test import TestCase from pandora import Box class BoxTests(TestCase): def test_get_set_item(self): box = Box() box['foo'] = 1 self.assertEqual(box['foo'], 1) def test_get_method(self): box = Box() self.assertEqual(box.get('foo', 0), 0) box['foo'] =...
{ "repo_name": "gregmuellegger/django-pandora", "path": "pandora_tests/tests.py", "copies": "1", "size": "1350", "license": "bsd-3-clause", "hash": -5226089856950773000, "line_mean": 23.5454545455, "line_max": 78, "alpha_frac": 0.5555555556, "autogenerated": false, "ratio": 3.6684782608695654, "...
from django.test import TestCase from pehg.http import JsonResponse, XmlResponse from pehg.serializers import JsonSerializer, MultiSerializer, XmlSerializer class TestJsonSerializer(TestCase): def setUp(self): self.serializer = JsonSerializer() def test_serialize(self): response = se...
{ "repo_name": "Rediker-Software/pehg", "path": "tests/tests/serializers.py", "copies": "1", "size": "3272", "license": "mit", "hash": -4104887139753033000, "line_mean": 42.0526315789, "line_max": 199, "alpha_frac": 0.6329462103, "autogenerated": false, "ratio": 4.351063829787234, "config_test":...
from django.test import TestCase from phonenumber_field.modelfields import PhoneNumberField from whats_fresh.whats_fresh_api.models import Vendor from django.contrib.gis.db import models class VendorTestCase(TestCase): def setUp(self): self.expected_fields = { 'name': models.TextField, ...
{ "repo_name": "iCHAIT/whats-fresh-api", "path": "whats_fresh/whats_fresh_api/tests/models/test_vendor_model.py", "copies": "2", "size": "2632", "license": "apache-2.0", "hash": 1157737972278571000, "line_mean": 35.0547945205, "line_max": 77, "alpha_frac": 0.5904255319, "autogenerated": false, "ra...
from django.test import TestCase from pollresults.forms import LeadForm # Create your tests here. class IndexTestGetCase(TestCase): def setUp(self): self.response = self.client.get('/') def test_index_should_return_200(self): self.assertEqual(self.response.status_code, 200) def ...
{ "repo_name": "elbasti/crowd-poll", "path": "crowdpolls/pollresults/tests.py", "copies": "1", "size": "1397", "license": "mit", "hash": 6497588425011843000, "line_mean": 32.2619047619, "line_max": 72, "alpha_frac": 0.6528274875, "autogenerated": false, "ratio": 3.935211267605634, "config_test":...
from django.test import TestCase from ....pricing.handler import PricingQueue from ....product.tests import DeadParrot from ....contrib.pricing.field import ProductFieldGetter from ....contrib.pricing.cache import PricingCacheHandler from decimal import Decimal class Cache(TestCase): def setUp(self): self...
{ "repo_name": "fusionbox/satchless", "path": "satchless/contrib/pricing/cache/tests.py", "copies": "1", "size": "1909", "license": "bsd-3-clause", "hash": -1271169757030895000, "line_mean": 45.5609756098, "line_max": 81, "alpha_frac": 0.6401257203, "autogenerated": false, "ratio": 3.3847517730496...
from django.test import TestCase from projects.models import Project from builds.constants import LATEST from builds.models import Version from core.templatetags import core_tags class CoreTagsTests(TestCase): fixtures = ["eric", "test_data"] def setUp(self): self.client.login(username='eric', passwor...
{ "repo_name": "cgourlay/readthedocs.org", "path": "readthedocs/rtd_tests/tests/test_core_tags.py", "copies": "5", "size": "7999", "license": "mit", "hash": 7406577957842734000, "line_mean": 44.4488636364, "line_max": 121, "alpha_frac": 0.632704088, "autogenerated": false, "ratio": 3.3259875259875...
from django.test import TestCase from projects.models import Project from builds.models import Version from core.templatetags import core_tags class CoreTagsTests(TestCase): fixtures = ["eric", "test_data"] def setUp(self): self.client.login(username='eric', password='test') self.pip = Project...
{ "repo_name": "KamranMackey/readthedocs.org", "path": "readthedocs/rtd_tests/tests/test_core_tags.py", "copies": "7", "size": "7971", "license": "mit", "hash": -8786757678097234000, "line_mean": 44.5485714286, "line_max": 121, "alpha_frac": 0.631037511, "autogenerated": false, "ratio": 3.33235785...
from django.test import TestCase from projects.models import Project from django.core.urlresolvers import reverse from django.contrib.auth.models import User from robocrm.models import RoboUser class ProjectLabelTests(TestCase): def setUp(self): self.project = Project.objects.create(name='TestProject') def...
{ "repo_name": "sreidy/roboticsclub.org", "path": "projects/tests/test_project_label.py", "copies": "2", "size": "1340", "license": "mit", "hash": -6181901663030651000, "line_mean": 32.5, "line_max": 112, "alpha_frac": 0.7179104478, "autogenerated": false, "ratio": 3.7746478873239435, "config_te...
from django.test import TestCase from projects.models import Project, ProjectMembership, Team from django.utils import timezone from django.core.exceptions import ValidationError from buildbuild import attributes_for_tests class ProjectMembership_test(TestCase): fixtures = ['properties_data.yaml'] def setUp(se...
{ "repo_name": "buildbuild/buildbuild", "path": "buildbuild/projects/tests/test_project_membership.py", "copies": "1", "size": "2249", "license": "bsd-3-clause", "hash": 1380865609914076700, "line_mean": 33.6, "line_max": 90, "alpha_frac": 0.6002667852, "autogenerated": false, "ratio": 4.507014028...
from django.test import TestCase from prototype.models import DiagramEntity from prototype.tests.TestUtilities import createTestDiagramEntity class DiagramEntityTest(TestCase): def setUp(self): self.diagramEntity = createTestDiagramEntity() def tearDown(self): self.diagramEntity.delete() ...
{ "repo_name": "DarioGT/docker-carra", "path": "src/prototype/tests/models/test_DiagramEntity.py", "copies": "1", "size": "1219", "license": "mit", "hash": -9222785821965492000, "line_mean": 41.0689655172, "line_max": 84, "alpha_frac": 0.7497949139, "autogenerated": false, "ratio": 3.6606606606606...
from django.test import TestCase from prototype.models import Project from prototype.tests.TestUtilities import createTestProject class ProjectTestCase(TestCase): def setUp(self): self.project = createTestProject() def tearDown(self): self.project.delete() def test_creating_a_new_project_...
{ "repo_name": "DarioGT/docker-carra", "path": "src/prototype/tests/models/test_project.py", "copies": "1", "size": "2622", "license": "mit", "hash": -2104762261775276500, "line_mean": 45.0175438596, "line_max": 86, "alpha_frac": 0.7177726926, "autogenerated": false, "ratio": 3.6416666666666666, ...
from django.test import TestCase from push_notifications.api.rest_framework import APNSDeviceSerializer, GCMDeviceSerializer from tests.mock_responses import GCM_DRF_INVALID_HEX_ERROR, GCM_DRF_OUT_OF_RANGE_ERROR class APNSDeviceSerializerTestCase(TestCase): def test_validation(self): # valid data - upper case se...
{ "repo_name": "vuchau/django-push-notifications", "path": "tests/test_rest_framework.py", "copies": "5", "size": "2231", "license": "mit", "hash": -2202656015946530300, "line_mean": 36.1833333333, "line_max": 111, "alpha_frac": 0.7413715823, "autogenerated": false, "ratio": 3.1202797202797203, ...
from django.test import TestCase from push_notifications.gcm import gcm_send_message, gcm_send_bulk_message from tests.test_models import GCM_PLAIN_RESPONSE, GCM_JSON_RESPONSE from ._mock import mock class GCMPushPayloadTest(TestCase): def test_push_payload(self): with mock.patch("push_notifications.gcm._gcm_send"...
{ "repo_name": "CustomerSupport/django-push-notifications", "path": "tests/test_gcm_push_payload.py", "copies": "1", "size": "1293", "license": "mit", "hash": 5124709323635896000, "line_mean": 43.5862068966, "line_max": 92, "alpha_frac": 0.7184841454, "autogenerated": false, "ratio": 2.93863636363...
from django.test import TestCase from qatrack.qa import models from qatrack.qa.views import forms from qatrack.qa.templatetags import qa_tags import utils #============================================================================ class TestTags(TestCase): """ These tests are only testing the tags return...
{ "repo_name": "sharifelguindi/qatrackplus", "path": "qatrack/qa/tests/test_tags.py", "copies": "1", "size": "6032", "license": "mit", "hash": -3314043514633635300, "line_mean": 40.3150684932, "line_max": 117, "alpha_frac": 0.4718169761, "autogenerated": false, "ratio": 4.461538461538462, "confi...
from django.test import TestCase from qmpy import * class SpacegroupTestCase(TestCase): def setUp(self): read_spacegroups([225]) def test_translations(self): trans = Translation.get([0, 0, 0]) self.assertEqual(str(trans), "0,0,0") self.assertTrue(np.allclose(trans.vector, [0, ...
{ "repo_name": "wolverton-research-group/qmpy", "path": "qmpy/analysis/symmetry/tests.py", "copies": "1", "size": "2481", "license": "mit", "hash": -7245286228730428000, "line_mean": 39.0161290323, "line_max": 88, "alpha_frac": 0.5622732769, "autogenerated": false, "ratio": 2.8882421420256112, "...
from django.test import TestCase from rapidsms.apps.base import AppBase from rapidsms.router.blocking import BlockingRouter class RouterAppTest(TestCase): """BlockingRouter app tests.""" def setUp(self): self.router = BlockingRouter(apps=[], backends={}) def test_valid_app_path(self): ""...
{ "repo_name": "lsgunth/rapidsms", "path": "rapidsms/router/blocking/tests/test_app.py", "copies": "4", "size": "1383", "license": "bsd-3-clause", "hash": -2046552663862803700, "line_mean": 36.3783783784, "line_max": 70, "alpha_frac": 0.6558206797, "autogenerated": false, "ratio": 3.62992125984252...
from django.test import TestCase from rapidsms.contrib.locations.models import Location, LocationType from survey.forms.surveys import SurveyForm from survey.models import Batch, Investigator, Backend, Household, HouseholdHead, HouseholdMemberBatchCompletion, EnumerationArea, Question, BatchQuestionOrder from survey.mo...
{ "repo_name": "antsmc2/mics", "path": "survey/tests/models/test_survey_model.py", "copies": "2", "size": "14587", "license": "bsd-3-clause", "hash": 8980932281396054000, "line_mean": 54.2575757576, "line_max": 159, "alpha_frac": 0.6436553095, "autogenerated": false, "ratio": 3.9811681222707422, ...
from django.test import TestCase from rapidsms.contrib.locations.models import Location, LocationType from survey.models import LocationTypeDetails from survey.utils.views_helper import contains_key, get_descendants, get_ancestors, clean_query_params, prepend_to_keys class ViewsHelperTest(TestCase): def test_con...
{ "repo_name": "unicefuganda/mics", "path": "survey/tests/utils/test_views_helper.py", "copies": "2", "size": "10214", "license": "bsd-3-clause", "hash": 5550135570831401000, "line_mean": 57.7011494253, "line_max": 122, "alpha_frac": 0.7044252986, "autogenerated": false, "ratio": 3.38885202388852,...
from django.test import TestCase from rapidsms.contrib.locations.models import Location from survey.forms.filters import QuestionFilterForm, IndicatorFilterForm, LocationFilterForm, SurveyBatchFilterForm from survey.models import Question, QuestionModule, HouseholdMemberGroup, Indicator, Batch, Survey, EnumerationArea ...
{ "repo_name": "unicefuganda/mics", "path": "survey/tests/forms/test_filter_form.py", "copies": "2", "size": "12338", "license": "bsd-3-clause", "hash": -9031732671488757000, "line_mean": 51.05907173, "line_max": 144, "alpha_frac": 0.6827686821, "autogenerated": false, "ratio": 3.5597230236583957,...
from django.test import TestCase from rapidsms.contrib.locations.models import Location from survey.forms.household import * from survey.models import EnumerationArea from survey.models.households import Household from survey.models.backend import Backend from survey.models.investigator import Investigator class Hous...
{ "repo_name": "antsmc2/mics", "path": "survey/tests/forms/test_household_form.py", "copies": "2", "size": "2816", "license": "bsd-3-clause", "hash": 3233470523740043300, "line_mean": 44.435483871, "line_max": 113, "alpha_frac": 0.6928267045, "autogenerated": false, "ratio": 3.705263157894737, "...
from django.test import TestCase from rapidsms_httprouter.management.commands.send_messages import Command from rapidsms_httprouter.models import Message, MessageBatch from rapidsms.models import Backend, Connection from django.conf import settings class StubSendMessagesCommand(Command): def __init__(self, **kwa...
{ "repo_name": "unicefuganda/edtrac", "path": "edtrac_project/rapidsms_httprouter_src/rapidsms_httprouter/management/commands/tests/send_messages_tests.py", "copies": "1", "size": "3274", "license": "bsd-3-clause", "hash": -4426055367670292000, "line_mean": 42.0789473684, "line_max": 144, "alpha_frac"...
from django.test import TestCase from react.render import render_component from pyquery import PyQuery from photos.api import FavoriteSerializer from photos.models import Photo, Favorite class ReactComponentsTests(TestCase): def setUp(self): # Create some photos photo1 = Photo.objects.create(url...
{ "repo_name": "dpetzold/django-react-djangocon2015", "path": "photos/tests.py", "copies": "2", "size": "1402", "license": "mit", "hash": 8566399847230779000, "line_mean": 30.1777777778, "line_max": 75, "alpha_frac": 0.622681883, "autogenerated": false, "ratio": 3.8836565096952906, "config_test"...
from django.test import TestCase from readthedocs.projects.models import Project class TestCanonical(TestCase): def setUp(self): self.p = Project( name='foo', repo='http://github.com/ericholscher/django-kong', ) self.p.save() def test_canonical_clean(self...
{ "repo_name": "Tazer/readthedocs.org", "path": "readthedocs/rtd_tests/tests/test_canonical.py", "copies": "23", "size": "1548", "license": "mit", "hash": 4027550248930576000, "line_mean": 38.6923076923, "line_max": 87, "alpha_frac": 0.6285529716, "autogenerated": false, "ratio": 3.409691629955947...
from django.test import TestCase from reguser.utils import generate_username class GenerateUsernameTestCase(TestCase): def setUp(self): self.emails = [ "me@example.com", "a@b.c", "b@domain.com", "a.nonymous@example.com", "name+tag@example.com", ...
{ "repo_name": "a115/reguser", "path": "reguser/tests/test_utils.py", "copies": "1", "size": "1045", "license": "unlicense", "hash": -8681747237441192000, "line_mean": 36.3214285714, "line_max": 80, "alpha_frac": 0.5186602871, "autogenerated": false, "ratio": 3.59106529209622, "config_test": fal...
from django.test import TestCase from resources.models import Resource from votes.models import Vote from django.contrib.auth.models import User from mock import patch class ResourceTestModels(TestCase): def setUp(self): self.user = User.objects.create( username='inioluwafageyinbo', password=...
{ "repo_name": "andela-ooshodi/codango-debug", "path": "codango/resources/tests/test_models.py", "copies": "1", "size": "2319", "license": "mit", "hash": -6307547248587862000, "line_mean": 33.1029411765, "line_max": 78, "alpha_frac": 0.6050021561, "autogenerated": false, "ratio": 4.310408921933085...
from django.test import TestCase from resrc.userprofile.tests.factories import UserFactory, ProfileFactory from resrc.link.tests.factories import LinkFactory from resrc.list.tests.factories import ListFactory from resrc.link.models import Link class UserprofileTestCase(TestCase): def setUp(self): self....
{ "repo_name": "mrbitsdcf/resrc", "path": "resrc/link/tests/models_tests.py", "copies": "3", "size": "2397", "license": "mit", "hash": 7511815687640595000, "line_mean": 26.2386363636, "line_max": 73, "alpha_frac": 0.5874009178, "autogenerated": false, "ratio": 3.923076923076923, "config_test": t...
from django.test import TestCase from restclients.canvas.users import Users from restclients.models.canvas import CanvasUser class CanvasTestUsers(TestCase): def test_get_user(self): with self.settings( RESTCLIENTS_CANVAS_DAO_CLASS='restclients.dao_implementation.canvas.File'): ...
{ "repo_name": "uw-it-cte/uw-restclients", "path": "restclients/test/canvas/users.py", "copies": "4", "size": "5214", "license": "apache-2.0", "hash": -4498543057427502000, "line_mean": 45.5535714286, "line_max": 148, "alpha_frac": 0.6150747986, "autogenerated": false, "ratio": 3.539714867617108, ...
from django.test import TestCase from restclients.models.sws import Person from restclients.pws import PWS from restclients.exceptions import InvalidIdCardPhotoSize, InvalidNetID from restclients.exceptions import DataFailureException from restclients.test import fdao_pws_override @fdao_pws_override class IdCardTestP...
{ "repo_name": "uw-it-aca/uw-restclients", "path": "restclients/test/pws/photo.py", "copies": "1", "size": "3027", "license": "apache-2.0", "hash": -2758328824633025000, "line_mean": 42.2428571429, "line_max": 77, "alpha_frac": 0.6603898249, "autogenerated": false, "ratio": 3.4633867276887873, "...