text
stringlengths
0
1.05M
meta
dict
from django.test import TestCase from django.test import Client from django.core.urlresolvers import reverse from .models import Project class ProjectsTests(TestCase): def setUp(self): """ Setup a test project. """ self.testProject = Project(title = "test title", description = "te...
{ "repo_name": "mariufa/DjangoTesting", "path": "djangoTesting/projects/tests.py", "copies": "1", "size": "1345", "license": "mit", "hash": -7543420381607272000, "line_mean": 28.2391304348, "line_max": 90, "alpha_frac": 0.6260223048, "autogenerated": false, "ratio": 4.574829931972789, "config_te...
from django.test import TestCase from django.test import Client from django.core.urlresolvers import reverse class CSRFTests(TestCase): """ Test cases for establishing the relative security settings for Django's CSRF Middleware. """ fixtures = ['test-data.json'] def test_csrf(self): ...
{ "repo_name": "archen/honeypot", "path": "honeypot/utils/tests.py", "copies": "1", "size": "3360", "license": "mit", "hash": 1456547256303982000, "line_mean": 35.1397849462, "line_max": 88, "alpha_frac": 0.6261904762, "autogenerated": false, "ratio": 4.2052565707133915, "config_test": true, "...
from django.test import TestCase from django.test import Client from django.db import transaction from ...views import IngredientSpecList from objetos.models import IngredientNickname, Ingredient class VinculateIngredientTests(TestCase): def test_send_id_null(self): c = Client(enforce_csrf_checks=False)...
{ "repo_name": "lucasgr7/silverplate", "path": "crawler/tests/test_views/test_vinculate_ingredient.py", "copies": "1", "size": "3224", "license": "mit", "hash": 1071557908951058700, "line_mean": 41.4342105263, "line_max": 101, "alpha_frac": 0.6743176179, "autogenerated": false, "ratio": 3.52735229...
from django.test import TestCase from django.test import Client from django.db.models import signals from base.models import Version from models import UploadedCrash from signals import process_uploaded_crash import os import tempfile import json def get_test_file_path(file_name): dir = os.path.dirname(__file__...
{ "repo_name": "Liongold/crash", "path": "django/crashreport/crashsubmit/tests.py", "copies": "2", "size": "4094", "license": "mpl-2.0", "hash": 4933911254506509000, "line_mean": 39.137254902, "line_max": 155, "alpha_frac": 0.6209086468, "autogenerated": false, "ratio": 3.4259414225941422, "conf...
from django.test import TestCase from django.test import Client from django.utils import timezone from ussd.models import UssdUser, Transaction import json from mock import patch # Create your tests here. class TestWithdrawalApi(TestCase): def setUp(self): self.user = UssdUser.objects.create( ...
{ "repo_name": "dirkcuys/save4life", "path": "ussd/tests/test_withdrawal.py", "copies": "1", "size": "4173", "license": "bsd-3-clause", "hash": -1567464559707403300, "line_mean": 32.6532258065, "line_max": 100, "alpha_frac": 0.5751258088, "autogenerated": false, "ratio": 3.725892857142857, "conf...
from django.test import TestCase from django.test import Client from models import BoardingVisit, Dog from utils import parse_date class DogTestCase(TestCase): def setUp(self): super(DogTestCase, self).setUp() self.dog_1, created = Dog.add(first_name = 'Skipper', last_name='Tercero') self.d...
{ "repo_name": "R3SWebDevelopment/HappyDogs", "path": "HappyDogs/HappyDogs/apps/HappyDogs/test.py", "copies": "1", "size": "4863", "license": "mit", "hash": 2556561138662074400, "line_mean": 38.5365853659, "line_max": 135, "alpha_frac": 0.6064157927, "autogenerated": false, "ratio": 3.083703233988...
from django.test import TestCase from django.test import Client class SearchTest(TestCase): fixtures = ['base.json'] def setUp(self): self.client = Client() def test_home_page(self): """ Only pagination """ response = self.client.get('/list/devices') self....
{ "repo_name": "SchroterQuentin/django-search-listview", "path": "search_listview/tests/tests.py", "copies": "1", "size": "4503", "license": "mit", "hash": -4239038804290578000, "line_mean": 38.1565217391, "line_max": 152, "alpha_frac": 0.5773928492, "autogenerated": false, "ratio": 3.761904761904...
from django.test import TestCase from django.test import Client from ..models import Deck, Result from datetime import datetime class ResultsTests(TestCase): @classmethod def setUpTestData(cls): #Create one deck Deck(name='test_deck_1', filename='test_filename_1').save() #Create some...
{ "repo_name": "edublancas/learning", "path": "quizzes/tests/test_results.py", "copies": "1", "size": "1084", "license": "mit", "hash": -3274329523632403000, "line_mean": 34, "line_max": 96, "alpha_frac": 0.6595940959, "autogenerated": false, "ratio": 3.5080906148867315, "config_test": true, "...
from django.test import TestCase from django.test import Client from payment.models import Currency from products.models import Category, Product, Unit, PricedProduct from cart.models import Cart, CartProducts from stock.models import Coming, Supplier, ComingProducts # Тесты для приложения cart class CartTestCase(T...
{ "repo_name": "juntatalor/qexx", "path": "cart/tests.py", "copies": "1", "size": "3480", "license": "mit", "hash": 8851836164594081000, "line_mean": 40.2739726027, "line_max": 104, "alpha_frac": 0.6540504648, "autogenerated": false, "ratio": 2.72579185520362, "config_test": true, "has_no_keyw...
from django.test import TestCase from django.test import Client class RegisterTestCase(TestCase): def test_register(self): c = Client() # on success redirects to / response = c.post('/accounts/register/', { 'username': 'asdas', 'password1': 'asdasdasd12', ...
{ "repo_name": "asb29/Redundant", "path": "auth/tests/test_views.py", "copies": "2", "size": "1446", "license": "mit", "hash": -5282888757211514000, "line_mean": 29.7659574468, "line_max": 52, "alpha_frac": 0.5318118949, "autogenerated": false, "ratio": 4.1671469740634, "config_test": true, "h...
from django.test import TestCase from django.test import override_settings import copy from mailer.models import MailNotifier from mailer.models import MailLog from mailer import receivers from mailer.signals import * # Ensure that the events exposed as choices for the # data model match expectations class EventCho...
{ "repo_name": "ResearchComputing/RCAMP", "path": "rcamp/tests/test_mailer.py", "copies": "1", "size": "14682", "license": "mit", "hash": -2445621454287809000, "line_mean": 37.8412698413, "line_max": 89, "alpha_frac": 0.5710393679, "autogenerated": false, "ratio": 3.8006730520320993, "config_tes...
from django.test import TestCase from django.test import override_settings from django_jinja.backend import Jinja2 from mock import patch from nose.tools import eq_ from bedrock.base.templatetags import helpers jinja_env = Jinja2.get_default() SEND_TO_DEVICE_MESSAGE_SETS = { 'default': { 'sms_countries'...
{ "repo_name": "MichaelKohler/bedrock", "path": "bedrock/base/tests/test_helpers.py", "copies": "2", "size": "3021", "license": "mpl-2.0", "hash": -955183588687946000, "line_mean": 30.8, "line_max": 75, "alpha_frac": 0.5951671632, "autogenerated": false, "ratio": 3.1733193277310923, "config_test...
from django.test import TestCase from django.test import override_settings from mock import patch from mock import MagicMock from twilio.base.exceptions import TwilioRestException from sims.models import Sim from phone_numbers.models import PhoneNumber from phone_numbers.tasks import buy_new_phone_number @overri...
{ "repo_name": "RobSpectre/garfield", "path": "garfield/phone_numbers/tests/test_tasks.py", "copies": "1", "size": "4039", "license": "mit", "hash": -8478445132375802000, "line_mean": 41.0729166667, "line_max": 78, "alpha_frac": 0.486011389, "autogenerated": false, "ratio": 4.477827050997782, "c...
from django.test import TestCase from django.test import override_settings from mock import patch from contacts.models import Contact from phone_numbers.models import PhoneNumber from sims.models import Sim from voice.models import Call from sms.models import SmsMessage import sms.tasks class TaskSmsMessageTestCa...
{ "repo_name": "RobSpectre/garfield", "path": "garfield/sms/tests/test_tasks.py", "copies": "1", "size": "20397", "license": "mit", "hash": -3661943881767333000, "line_mean": 48.387409201, "line_max": 79, "alpha_frac": 0.430210325, "autogenerated": false, "ratio": 5.076406172224988, "config_test...
from django.test import TestCase from django.test import TestCase from crawler.LinkFinder import LinkFinder from crawler.DataFinder import IngredienteFinder from crawler.models import Dados_Ingrediente from crawler.DataMining import Data_Mining import urllib.request # Create your tests here. class testCrawler(TestCase...
{ "repo_name": "chentr/silverplate", "path": "crawler/test.py", "copies": "1", "size": "2155", "license": "mit", "hash": 3716941506376573400, "line_mean": 40.4615384615, "line_max": 158, "alpha_frac": 0.7461716937, "autogenerated": false, "ratio": 3.0567375886524824, "config_test": true, "has_...
from django.test import TestCase from django.test.runner import DiscoverRunner class DiscoverRunnerTest(TestCase): def test_dotted_test_module(self): count = DiscoverRunner().build_suite( ["test_discovery_sample.tests_sample"], ).countTestCases() self.assertEqual(count, 3) ...
{ "repo_name": "jgeskens/django", "path": "tests/test_runner/test_discover_runner.py", "copies": "2", "size": "2126", "license": "bsd-3-clause", "hash": 2231558754781456600, "line_mean": 30.2647058824, "line_max": 83, "alpha_frac": 0.6425211665, "autogenerated": false, "ratio": 4.011320754716981, ...
from django.test import TestCase from django.test.simple import DjangoTestSuiteRunner from django.utils.unittest import TextTestRunner from .utils import object_list_to_table class ModelTestCase(TestCase): """ A test case for models that provides an easy way to validate the DB contents against a given li...
{ "repo_name": "adamjmcgrath/glancydesign", "path": "djangotoolbox/test.py", "copies": "36", "size": "1881", "license": "bsd-3-clause", "hash": -6315859762176114000, "line_mean": 30.8813559322, "line_max": 71, "alpha_frac": 0.5964912281, "autogenerated": false, "ratio": 4.510791366906475, "confi...
from django.test import TestCase from django.test.utils import override_settings from casexml.apps.case.exceptions import IllegalCaseId from casexml.apps.case.models import CommCareCase from casexml.apps.case.xform import process_cases from couchforms.tests.testutils import post_xform_to_couch ALICE_XML = """<?xml ver...
{ "repo_name": "benrudolph/commcare-hq", "path": "corehq/ex-submodules/casexml/apps/case/tests/test_domains.py", "copies": "2", "size": "4694", "license": "bsd-3-clause", "hash": 8914444918165074000, "line_mean": 50.5824175824, "line_max": 184, "alpha_frac": 0.6691521091, "autogenerated": false, "...
from django.test import TestCase from django.test.utils import override_settings from casexml.apps.case.mock import CaseBlock from casexml.apps.case.util import post_case_blocks from casexml.apps.phone.models import get_properly_wrapped_sync_log from datetime import datetime from casexml.apps.phone.checksum import EMPT...
{ "repo_name": "qedsoftware/commcare-hq", "path": "corehq/ex-submodules/casexml/apps/phone/tests/test_state_hash.py", "copies": "1", "size": "4075", "license": "bsd-3-clause", "hash": -1949356978899045000, "line_mean": 41.8947368421, "line_max": 103, "alpha_frac": 0.643190184, "autogenerated": false...
from django.test import TestCase from django.test.utils import override_settings from casexml.apps.case.mock import CaseBlock from casexml.apps.phone.models import User, get_properly_wrapped_sync_log from datetime import datetime from casexml.apps.phone.checksum import EMPTY_HASH, CaseStateHash from casexml.apps.case.x...
{ "repo_name": "puttarajubr/commcare-hq", "path": "corehq/ex-submodules/casexml/apps/phone/tests/test_state_hash.py", "copies": "1", "size": "3811", "license": "bsd-3-clause", "hash": -2427296927080670700, "line_mean": 46.049382716, "line_max": 103, "alpha_frac": 0.642351089, "autogenerated": false,...
from django.test import TestCase from django.test.utils import override_settings from datetime import datetime from djcelery.models import PeriodicTask, IntervalSchedule from StringIO import StringIO from subscription.management.commands.mark_completed import ( SUBSCRIPTION_ACCELERATED, SUBSCRIPTION_BABY1, SUBSC...
{ "repo_name": "praekelt/ndoh-control", "path": "subscription/management/commands/tests/test_mark_completed.py", "copies": "1", "size": "6962", "license": "bsd-3-clause", "hash": -9008660049991733000, "line_mean": 39.2427745665, "line_max": 78, "alpha_frac": 0.6197931629, "autogenerated": false, "...
from django.test import TestCase from django.test.utils import override_settings from django.conf import settings from django.core import management import unittest from wagtail.wagtailsearch import models, get_search_backend from wagtail.wagtailsearch.backends.db import DBSearch from wagtail.wagtailsearch.backends imp...
{ "repo_name": "suziesparkle/wagtail", "path": "wagtail/wagtailsearch/tests/test_backends.py", "copies": "3", "size": "6217", "license": "bsd-3-clause", "hash": 8029551486167825000, "line_mean": 33.5388888889, "line_max": 138, "alpha_frac": 0.6752452952, "autogenerated": false, "ratio": 4.19500674...
from django.test import TestCase from django.test.utils import override_settings from django.conf.urls import url from django.core.urlresolvers import reverse from rapidsms.tests.harness import RapidTest from rapidsms.backends.http import views from rapidsms.backends.http.forms import BaseHttpForm, GenericHttpForm c...
{ "repo_name": "catalpainternational/rapidsms", "path": "rapidsms/backends/http/tests.py", "copies": "1", "size": "5530", "license": "bsd-3-clause", "hash": -3461768809711263000, "line_mean": 41.8682170543, "line_max": 77, "alpha_frac": 0.6475587703, "autogenerated": false, "ratio": 3.981281497480...
from django.test import TestCase from django.test.utils import override_settings from django.contrib.auth import signals class SignalTestCase(TestCase): urls = 'django.contrib.auth.tests.urls' fixtures = ['authtestdata.json'] def listener_login(self, user, **kwargs): self.logged_in.append(user) ...
{ "repo_name": "Kazade/NeHe-Website", "path": "google_appengine/lib/django-1.4/django/contrib/auth/tests/signals.py", "copies": "77", "size": "1888", "license": "bsd-3-clause", "hash": 5334435923843743000, "line_mean": 36.76, "line_max": 78, "alpha_frac": 0.6710805085, "autogenerated": false, "rat...
from django.test import TestCase from django.test.utils import override_settings from django.contrib.auth import signals @override_settings(USE_TZ=False) class SignalTestCase(TestCase): urls = 'django.contrib.auth.tests.urls' fixtures = ['authtestdata.json'] def listener_login(self, user, **kwargs): ...
{ "repo_name": "svn2github/django", "path": "django/contrib/auth/tests/signals.py", "copies": "5", "size": "1855", "license": "bsd-3-clause", "hash": -1252015004133520000, "line_mean": 36.8571428571, "line_max": 78, "alpha_frac": 0.6679245283, "autogenerated": false, "ratio": 3.8405797101449277, ...
from django.test import TestCase from django.test.utils import override_settings from django.contrib.auth.models import User from django.conf import settings from django.core.management import call_command from django.utils import timezone from datetime import datetime import types from models import MobileDevice, Pus...
{ "repo_name": "nathanjhaveri/django-push-notify", "path": "push_notify/tests.py", "copies": "1", "size": "4087", "license": "mit", "hash": -3261364504308655600, "line_mean": 32.7768595041, "line_max": 82, "alpha_frac": 0.6422804013, "autogenerated": false, "ratio": 3.9373795761079, "config_test...
from django.test import TestCase from django.test.utils import override_settings from django.contrib.auth.models import User from django.db import IntegrityError from organizations.models import (Organization, OrganizationUser, OrganizationOwner) @override_settings(USE_TZ=True) class ActiveManagerTests(TestC...
{ "repo_name": "Suite5/DataColibri", "path": "organizations/tests/test_models.py", "copies": "1", "size": "3841", "license": "mit", "hash": 1457584168542697700, "line_mean": 37.797979798, "line_max": 77, "alpha_frac": 0.6802915907, "autogenerated": false, "ratio": 3.6826462128475552, "config_tes...
from django.test import TestCase from django.test.utils import override_settings from django.contrib.auth.models import User import mock import jenkinsapi from jenkins.models import Build from jenkins.tasks import ( build_job, push_job_to_jenkins, import_build_for_job, delete_job_from_jenkins, extract_request...
{ "repo_name": "caio1982/capomastro", "path": "jenkins/tests/test_tasks.py", "copies": "1", "size": "11189", "license": "mit", "hash": 7577954010483202000, "line_mean": 39.6872727273, "line_max": 79, "alpha_frac": 0.6211457682, "autogenerated": false, "ratio": 3.871626297577855, "config_test": t...
from django.test import TestCase from django.test.utils import override_settings from django.core import mail from django.apps import apps from django.conf import settings from backends import console, database, filebased from models import Email, Recipient from mock import patch from django.urls import reverse import ...
{ "repo_name": "gitcommitpush/django-mailtrail", "path": "mailtrail/tests.py", "copies": "1", "size": "7198", "license": "mit", "hash": 3122192037306638300, "line_mean": 37.4919786096, "line_max": 127, "alpha_frac": 0.6235065296, "autogenerated": false, "ratio": 3.946271929824561, "config_test":...
from django.test import TestCase from django.test.utils import override_settings from django.core import management from django.db.models.signals import post_save from StringIO import StringIO import responses import json from snappybouncer.models import (UserAccount, Conversation, Ticket, ...
{ "repo_name": "praekelt/ndoh-control", "path": "subscription/management/commands/tests/test_snappy_ticket_backfill.py", "copies": "1", "size": "5126", "license": "bsd-3-clause", "hash": -6564533894507976000, "line_mean": 36.9703703704, "line_max": 76, "alpha_frac": 0.5967616075, "autogenerated": fa...
from django.test import TestCase from django.test.utils import override_settings from django.db.utils import IntegrityError from models import MailServer, MailUser import methods CORRECT_INTERNAL_PASSWORD = u"pass123" INTERNAL_USERNAME = u"a_username@example.com" EXTERNAL_USERNAME=u"a_real_username@example.com" EXTER...
{ "repo_name": "V-Alexeev/nginxmailauth", "path": "nginxmailauth/tests.py", "copies": "1", "size": "9311", "license": "bsd-2-clause", "hash": 9096470716111407000, "line_mean": 46.0303030303, "line_max": 128, "alpha_frac": 0.626463323, "autogenerated": false, "ratio": 4.034228769497401, "config_t...
from django.test import TestCase from django.test.utils import override_settings from django.test.client import RequestFactory from django.template import Template, RequestContext, TemplateSyntaxError from django.db import models from menuz.models import Menuz, MenuzItem from menuz.tests import ModelSample @override_...
{ "repo_name": "ekaputra07/django-menuz", "path": "menuz/tests/test_template_tags.py", "copies": "1", "size": "3429", "license": "bsd-3-clause", "hash": 2004047855954664200, "line_mean": 33.9897959184, "line_max": 76, "alpha_frac": 0.5680956547, "autogenerated": false, "ratio": 4.181707317073171, ...
from django.test import TestCase from django.test.utils import override_settings from django.urls import path from rest_framework import serializers from rest_framework.generics import ListCreateAPIView from rest_framework.renderers import BrowsableAPIRenderer class NestedSerializer(serializers.Serializer): one ...
{ "repo_name": "tomchristie/django-rest-framework", "path": "tests/browsable_api/test_browsable_nested_api.py", "copies": "3", "size": "1295", "license": "bsd-2-clause", "hash": 4470025763900915000, "line_mean": 31.375, "line_max": 84, "alpha_frac": 0.7366795367, "autogenerated": false, "ratio": 4...
from django.test import TestCase from django.test.utils import override_settings from django.utils.encoding import force_text from libretto.api import build_ancrage from libretto.models import Evenement @override_settings(CACHALOT_ENABLED=False) class BuildAncrageTestCase(TestCase): cleans_up_after_itself = True ...
{ "repo_name": "dezede/dezede", "path": "libretto/tests/api/models/espace_temps.py", "copies": "1", "size": "2533", "license": "bsd-3-clause", "hash": -4939955611664845000, "line_mean": 34.676056338, "line_max": 68, "alpha_frac": 0.6557441769, "autogenerated": false, "ratio": 3.346103038309115, ...
from django.test import TestCase from django.test.utils import override_settings from django.utils import timezone from django.core.management import call_command from ct.models import Course, CourseUnit, Unit, UnitLesson, Role @override_settings(SUSPEND_SIGNALS=True) class CloneCourseCommandTest(TestCase): fixtu...
{ "repo_name": "raccoongang/socraticqs2", "path": "mysite/ct/tests/commands.py", "copies": "2", "size": "2874", "license": "apache-2.0", "hash": 897877705396394600, "line_mean": 30.2391304348, "line_max": 86, "alpha_frac": 0.6155184412, "autogenerated": false, "ratio": 3.417360285374554, "config...
from django.test import TestCase from django.test.utils import override_settings from haystack.utils import log from haystack.utils import get_identifier, get_facet_field_name, Highlighter, _lookup_identifier_method from core.models import MockModel class GetIdentifierTestCase(TestCase): def test_get_facet_field_...
{ "repo_name": "dionysio/django-haystack", "path": "tests/core/tests/test_utils.py", "copies": "8", "size": "13296", "license": "bsd-3-clause", "hash": 7503717486345529000, "line_mean": 71.2608695652, "line_max": 470, "alpha_frac": 0.671555355, "autogenerated": false, "ratio": 3.6298116298116296, ...
from django.test import TestCase from django.test.utils import override_settings from couchexport.models import SavedExportSchema from corehq.apps.reports.dbaccessors import ( get_all_hq_group_export_configs, hq_group_export_configs_by_domain, stale_get_exports_json, stale_get_export_count, ) from cor...
{ "repo_name": "qedsoftware/commcare-hq", "path": "corehq/apps/reports/tests/test_dbaccessors.py", "copies": "1", "size": "2286", "license": "bsd-3-clause", "hash": 874127799810772900, "line_mean": 37.7457627119, "line_max": 112, "alpha_frac": 0.7204724409, "autogenerated": false, "ratio": 3.68115...
from django.test import TestCase from django.test.utils import override_settings from ct.models import Response, UnitLesson from grading.models import CorrectnessMeter class BaseGraderTests(TestCase): def test_search_graders(self): """Test that discovering graders works properly.""" from base_gra...
{ "repo_name": "raccoongang/socraticqs2", "path": "mysite/grading/tests.py", "copies": "1", "size": "3326", "license": "apache-2.0", "hash": -5158103236874426000, "line_mean": 38.5952380952, "line_max": 110, "alpha_frac": 0.6888153939, "autogenerated": false, "ratio": 3.8362168396770473, "config...
from django.test import TestCase from django.test.utils import override_settings from djcelery.models import PeriodicTask, IntervalSchedule from StringIO import StringIO from subscription.management.commands.reset_status import ( SUBSCRIPTION_ACCELERATED) from subscription.management.commands import reset_status...
{ "repo_name": "praekelt/ndoh-control", "path": "subscription/management/commands/tests/test_reset_status.py", "copies": "1", "size": "11697", "license": "bsd-3-clause", "hash": -8320501406905442000, "line_mean": 34.8803680982, "line_max": 73, "alpha_frac": 0.5757031718, "autogenerated": false, "r...
from django.test import TestCase from django.test.utils import override_settings from djrichtextfield import settings from djrichtextfield.sanitizer import noop, SanitizerMixin class TestSanitizerMixin(TestCase): def test_get_sanitizer_returns_provided_sanitzer(self): """ Provided sanitizer is re...
{ "repo_name": "jaap3/django-richtextfield", "path": "testproject/tests/test_sanitizer.py", "copies": "1", "size": "2199", "license": "mit", "hash": 803190712472340000, "line_mean": 33.359375, "line_max": 93, "alpha_frac": 0.6530241019, "autogenerated": false, "ratio": 3.8646748681898067, "confi...
from django.test import TestCase from django.test.utils import override_settings from leads.tasks import ( create_lead_from_file, send_email, send_email_to_assigned_user, send_lead_assigned_emails, ) from leads.tests import TestLeadModel class TestCeleryTasks(TestLeadModel, TestCase): @override_s...
{ "repo_name": "MicroPyramid/Django-CRM", "path": "leads/tests_celery_tasks.py", "copies": "1", "size": "3971", "license": "mit", "hash": -7169533270827991000, "line_mean": 28.8571428571, "line_max": 68, "alpha_frac": 0.3998992697, "autogenerated": false, "ratio": 4.358946212952799, "config_test...
from django.test import TestCase from django.test.utils import override_settings from mama_cas.utils import add_query_params from mama_cas.utils import is_scheme_https from mama_cas.utils import clean_service_url from mama_cas.utils import is_valid_service_url from mama_cas.utils import redirect from mama_cas.utils im...
{ "repo_name": "forcityplatform/django-mama-cas", "path": "mama_cas/tests/test_utils.py", "copies": "2", "size": "4364", "license": "bsd-3-clause", "hash": -419105132055452540, "line_mean": 37.9642857143, "line_max": 79, "alpha_frac": 0.6141154904, "autogenerated": false, "ratio": 3.96007259528130...
from django.test import TestCase from django.test.utils import override_settings from mock import patch, Mock from nose.tools import ok_ from news.backends.exacttarget import logged_in @patch('news.backends.exacttarget.Client') class TestWSDLSwitch(TestCase): def setUp(self): # clear the cached client ...
{ "repo_name": "pmclanahan/basket", "path": "news/tests/test_backend_exacttarget.py", "copies": "2", "size": "1037", "license": "mpl-2.0", "hash": -8734116598034714000, "line_mean": 32.4516129032, "line_max": 70, "alpha_frac": 0.68756027, "autogenerated": false, "ratio": 3.5635738831615122, "con...
from django.test import TestCase from django.test.utils import override_settings from mock import patch, Mock from .management.commands.wtfd import Command from . import MissingDocstringsException TEST_APP_NAME = 'test_app' class WTFDCommandTestCase(TestCase): """ Tests for wtfd command. """ def ...
{ "repo_name": "postatum/django-wtfd", "path": "django_wtfd/tests.py", "copies": "1", "size": "4767", "license": "mit", "hash": 2364392570855775000, "line_mean": 36.8333333333, "line_max": 84, "alpha_frac": 0.6574365429, "autogenerated": false, "ratio": 3.647283856159143, "config_test": true, ...
from django.test import TestCase from django.test.utils import override_settings from nose.tools import eq_ from csp.utils import build_policy def policy_eq(a, b, msg='%r != %r'): parts_a = sorted(a.split('; ')) parts_b = sorted(b.split('; ')) assert parts_a == parts_b, msg % (a, b) class UtilsTests(T...
{ "repo_name": "graingert/django-csp", "path": "csp/tests/test_utils.py", "copies": "1", "size": "3829", "license": "bsd-3-clause", "hash": 1044812889378861200, "line_mean": 35.8173076923, "line_max": 73, "alpha_frac": 0.6278401671, "autogenerated": false, "ratio": 3.561860465116279, "config_tes...
from django.test import TestCase from django.test.utils import override_settings from readthedocs.builds.constants import LATEST from readthedocs.projects.models import Project from readthedocs.redirects.models import Redirect import logging class RedirectTests(TestCase): fixtures = ["eric", "test_data"] d...
{ "repo_name": "sid-kap/readthedocs.org", "path": "readthedocs/rtd_tests/tests/test_redirects.py", "copies": "4", "size": "9537", "license": "mit", "hash": 9138396000793084000, "line_mean": 39.9313304721, "line_max": 110, "alpha_frac": 0.6182237601, "autogenerated": false, "ratio": 3.5440356744704...
from django.test import TestCase from django.test.utils import override_settings from wagtail.admin import widgets from wagtail.core.models import Page from wagtail.tests.testapp.forms import AdminStarDateInput from wagtail.tests.testapp.models import EventPage, SimplePage class TestAdminPageChooserWidget(TestCase):...
{ "repo_name": "mixxorz/wagtail", "path": "wagtail/admin/tests/test_widgets.py", "copies": "3", "size": "8638", "license": "bsd-3-clause", "hash": -3063320653520110000, "line_mean": 37.3911111111, "line_max": 118, "alpha_frac": 0.6175040519, "autogenerated": false, "ratio": 3.5827457486520116, "...
from django.test import TestCase from django.test.utils import override_settings from wagtail.admin import widgets from wagtail.core.models import Page from wagtail.tests.testapp.models import EventPage, SimplePage class TestAdminPageChooserWidget(TestCase): def setUp(self): self.root_page = Page.objects...
{ "repo_name": "nealtodd/wagtail", "path": "wagtail/admin/tests/test_widgets.py", "copies": "3", "size": "8188", "license": "bsd-3-clause", "hash": 4459488057122945000, "line_mean": 37.261682243, "line_max": 118, "alpha_frac": 0.6140693698, "autogenerated": false, "ratio": 3.5507372072853425, "c...
from django.test import TestCase from django.test.utils import override_settings import django_dynamic_fixture as fixture from readthedocs.projects.models import Project @override_settings( USE_SUBDOMAIN=True, PUBLIC_DOMAIN='public.readthedocs.org', SERVE_PUBLIC_DOCS=True ) class RedirectSingleVersionTests(Test...
{ "repo_name": "tddv/readthedocs.org", "path": "readthedocs/rtd_tests/tests/test_single_version.py", "copies": "2", "size": "1242", "license": "mit", "hash": 340674203981595400, "line_mean": 39.064516129, "line_max": 100, "alpha_frac": 0.6425120773, "autogenerated": false, "ratio": 4.0324675324675...
from django.test import TestCase from django.test.utils import override_settings import mock from jenkinsapi import jenkins from jenkins.tasks import build_job, push_job_to_jenkins, import_build from .factories import ( JobFactory, JenkinsServerFactory, JobTypeFactory) class BuildJobTaskTest(TestCase): def...
{ "repo_name": "timrchavez/capomastro", "path": "jenkins/tests/test_tasks.py", "copies": "1", "size": "5758", "license": "mit", "hash": -6479740906685831000, "line_mean": 36.3896103896, "line_max": 88, "alpha_frac": 0.6245224036, "autogenerated": false, "ratio": 3.7292746113989637, "config_test"...
from django.test import TestCase from django.test.utils import override_settings import mock import jenkinsapi.job from jenkins.helpers import import_build_for_job, create_job from jenkins.models import Build, Job from .factories import ( JobFactory, BuildFactory, JobTypeFactory, JenkinsServerFactory) class Imp...
{ "repo_name": "timrchavez/capomastro", "path": "jenkins/tests/test_helpers.py", "copies": "1", "size": "2556", "license": "mit", "hash": -4818281661976615000, "line_mean": 35.5142857143, "line_max": 77, "alpha_frac": 0.6553208138, "autogenerated": false, "ratio": 3.8610271903323263, "config_tes...
from django.test import TestCase from django.test.utils import override_settings import shanghai from shanghai.resources import ModelResource class AutodiscoverTestCase(TestCase): def setUp(self): self.api = shanghai.api def test_app_should_have_registered_resources(self): articles = self.a...
{ "repo_name": "bobisjan/django-shanghai", "path": "tests/integration/autodiscover.py", "copies": "1", "size": "1118", "license": "mit", "hash": 8647829826676926000, "line_mean": 29.2162162162, "line_max": 65, "alpha_frac": 0.7200357782, "autogenerated": false, "ratio": 3.97864768683274, "config...
from django.test import TestCase from django.test.utils import override_settings class TestCheckRequiredSettings(TestCase): def _callFUT(self, *args, **kwargs): from redisio.checks import check_required_settings return check_required_settings(*args, **kwargs) @override_settings( REDIS...
{ "repo_name": "bungoume/django-redisio", "path": "redisio/tests/test_checks.py", "copies": "1", "size": "1315", "license": "mit", "hash": -7671818193776947000, "line_mean": 34.5405405405, "line_max": 87, "alpha_frac": 0.6076045627, "autogenerated": false, "ratio": 3.984848484848485, "config_tes...
from django.test import TestCase from django.test.utils import override_settings @override_settings(ADMINS=(('admin', 'admin@example.com'),), EMAIL_SUBJECT_PREFIX="") class TestApplyReporter(TestCase): def _makeOne(self, *args, **kwargs): from reportmail.command import apply_reporter ...
{ "repo_name": "hirokiky/django-reportmail", "path": "tests/test_command.py", "copies": "1", "size": "3291", "license": "mit", "hash": -6233376879906115000, "line_mean": 31.91, "line_max": 80, "alpha_frac": 0.5834092981, "autogenerated": false, "ratio": 3.9746376811594204, "config_test": true, ...
from django.test import TestCase from django.test.utils import override_settings @override_settings( TEMPLATE_CONTEXT_PROCESSORS=('django.core.context_processors.static',), STATIC_URL='/path/to/static/media/', ) class ShortcutTests(TestCase): urls = 'view_tests.generic_urls' def test_render_to_respon...
{ "repo_name": "AlexHill/django", "path": "tests/view_tests/tests/test_shortcuts.py", "copies": "5", "size": "3445", "license": "bsd-3-clause", "hash": -8384437194369271000, "line_mean": 47.5211267606, "line_max": 97, "alpha_frac": 0.6894049347, "autogenerated": false, "ratio": 3.688436830835118, ...
from django.test import TestCase from django.test.utils import setup_test_environment from django.core.urlresolvers import reverse from lrs import views import json from os import path import sys import base64 from lrs.models import Agent class AgentsTests(TestCase): @classmethod def setUpClass(cls): p...
{ "repo_name": "varunasingh/ustadmobile-tincanlrs", "path": "lrs/tests/AgentsTests.py", "copies": "2", "size": "3202", "license": "apache-2.0", "hash": -7778020420045231000, "line_mean": 50.6451612903, "line_max": 183, "alpha_frac": 0.6689569019, "autogenerated": false, "ratio": 3.553829078801332,...
from django.test import TestCase from django.test.utils import setup_test_environment from django.test import Client from imageapp.tests.Models import test_helper from imageapp.models import User import imageapp.views class QuestionMethodTests(TestCase): def setUp(self): first_name = "Joe" second...
{ "repo_name": "REALDrummer/ImageSpace-Django-functional-testing", "path": "ImageHostingApp-Django-master/ImageHostingApp-Django-master/imageapp/tests/Models/test_register_view.py", "copies": "7", "size": "2066", "license": "mit", "hash": 5020289577203518000, "line_mean": 32.3225806452, "line_max": 104,...
from django.test import TestCase from django_twitter_auth.models import TwitterProfile from django.contrib.auth import get_user_model User = get_user_model() from mock import patch class TwitterProfileModelTest(TestCase): def setUp(self): patcher = patch('django_twitter_auth.models.Twython') self.mock_Twython =...
{ "repo_name": "dylanbfox/simple-django-twitter-auth", "path": "django_twitter_auth/tests/test_models.py", "copies": "1", "size": "2608", "license": "mit", "hash": -712555526868276200, "line_mean": 29.3255813953, "line_max": 76, "alpha_frac": 0.7365797546, "autogenerated": false, "ratio": 3.130852...
from django.test import TestCase from django.urls import resolve from api.models import Image from api.serializers import ImageSerializer from rest_framework import status from rest_framework.test import APIRequestFactory from api.views.images import ImageViewSet class ImageListViewTest(TestCase): def setUp(self...
{ "repo_name": "frostblooded/kanq", "path": "api/tests/untest_image_views.py", "copies": "1", "size": "1986", "license": "mit", "hash": -6020518677929567000, "line_mean": 37.9411764706, "line_max": 90, "alpha_frac": 0.6711983887, "autogenerated": false, "ratio": 3.7471698113207546, "config_test"...
from django.test import TestCase from django.urls import resolve, reverse from ..models import Board from ..views import TopicListView class BoardTopicsTests(TestCase): def setUp(self): Board.objects.create(name='Django', description='Django board.') def test_board_topics_view_success_status_code(se...
{ "repo_name": "sibtc/django-beginners-guide", "path": "boards/tests/test_view_board_topics.py", "copies": "1", "size": "1286", "license": "mit", "hash": -2524147656538203000, "line_mean": 39.1875, "line_max": 73, "alpha_frac": 0.6702954899, "autogenerated": false, "ratio": 3.7060518731988474, "...
from django.test import TestCase from django.urls import reverse from collections import OrderedDict from OmniDB import settings import OmniDB_app.include.OmniDatabase.SQLite import OmniDB_app.include.Spartacus.Utils from .utils_testing import ( build_client_ajax_request, execute_client_login, get_client_a...
{ "repo_name": "barthisrael/OmniDB", "path": "OmniDB/OmniDB_app/tests/test_views.py", "copies": "3", "size": "17460", "license": "mit", "hash": 857129941570371100, "line_mean": 37.9732142857, "line_max": 142, "alpha_frac": 0.5793814433, "autogenerated": false, "ratio": 3.792354474370113, "config...
from django.test import TestCase from django.urls import reverse from django.contrib.auth import get_user_model from petition.models import Organization, Petition, PytitionUser, SlugModel, Signature, Permission class SignatureTest(TestCase): def setUp(self): User = get_user_model() u = User.object...
{ "repo_name": "fallen/Pytition", "path": "pytition/petition/tests/tests_Signature.py", "copies": "1", "size": "1724", "license": "bsd-3-clause", "hash": 6583292583695747000, "line_mean": 48.2571428571, "line_max": 160, "alpha_frac": 0.6948955916, "autogenerated": false, "ratio": 3.644820295983086...
from django.test import TestCase from django.urls import reverse from django.contrib.auth import get_user_model from petition.models import Organization, Petition, PytitionUser, Permission from .utils import add_default_data class LeaveOrgViewTest(TestCase): """Test LeaveOrg view""" @classmethod def setU...
{ "repo_name": "fallen/Pytition", "path": "pytition/petition/tests/tests_LeaveOrg.py", "copies": "1", "size": "2357", "license": "bsd-3-clause", "hash": 1555159567634099500, "line_mean": 40.350877193, "line_max": 107, "alpha_frac": 0.6737378023, "autogenerated": false, "ratio": 3.77724358974359, ...
from django.test import TestCase from django.urls import reverse from django.contrib.auth import get_user_model from petition.models import Organization, Petition, PytitionUser, Permission users = ['julia', 'john', 'max', 'sarah'] orgs = ['RAP', 'Greenpeace', 'Attac', 'Les Amis de la Terre'] org_members = { 'RA...
{ "repo_name": "fallen/Pytition", "path": "pytition/petition/tests/tests_PetitionCreationWizard.py", "copies": "1", "size": "3027", "license": "bsd-3-clause", "hash": -133865575895978240, "line_mean": 38.3116883117, "line_max": 117, "alpha_frac": 0.6395771391, "autogenerated": false, "ratio": 3.72...
from django.test import TestCase from django.urls import reverse from django.contrib import auth from django.contrib.auth import authenticate from django.contrib.auth.models import User # Create your tests here. from freelancers.models import Skill from freelancers.models import Profile class ProfileViews(TestCase): ...
{ "repo_name": "TheWebMonks/equipo", "path": "app/freelancers/tests.py", "copies": "1", "size": "1709", "license": "apache-2.0", "hash": -7069248884171805000, "line_mean": 39.6904761905, "line_max": 164, "alpha_frac": 0.6606202458, "autogenerated": false, "ratio": 3.901826484018265, "config_test...
from django.test import TestCase from django.urls import reverse from django.contrib import auth from django.contrib.auth.models import User import datetime from django.contrib.auth.models import UserManager import webcmd.cmdtext as cmdtext from .forms import CmdForm from sshcomm.models import RemoteServer, UserData ...
{ "repo_name": "t-mertz/slurmCompanion", "path": "django-web/webcmd/tests.py", "copies": "1", "size": "4281", "license": "mit", "hash": -6964234882392562000, "line_mean": 31.4393939394, "line_max": 119, "alpha_frac": 0.6433076384, "autogenerated": false, "ratio": 3.735602094240838, "config_test"...
from django.test import TestCase from django.urls import reverse from django.core import mail from django.contrib.auth.models import User from securedpi_locks.models import Lock class RegistrationTestCase(TestCase): """Setup Registration test case.""" def setUp(self): """Set up for registration test c...
{ "repo_name": "Secured-Pi/Secured-Pi", "path": "securedpi/test.py", "copies": "1", "size": "10525", "license": "mit", "hash": 6388894616994518000, "line_mean": 37.6948529412, "line_max": 88, "alpha_frac": 0.6147268409, "autogenerated": false, "ratio": 4.063706563706564, "config_test": true, "...
from django.test import TestCase from django.urls import reverse from django.utils import timezone from wagtail.tests.utils import WagtailTestUtils from wagtail.wagtailcore.models import Page from wagtail_calendar.tests.utils import TestEventsMixin class TestPlanningCalendarView(TestEventsMixin, WagtailTestUtils, Te...
{ "repo_name": "Gagaro/wagtail-calendar", "path": "wagtail_calendar/tests/test_views.py", "copies": "1", "size": "2433", "license": "bsd-3-clause", "hash": -4063393006113929000, "line_mean": 42.4464285714, "line_max": 110, "alpha_frac": 0.6880394575, "autogenerated": false, "ratio": 3.490674318507...
from django.test import TestCase from django.urls import reverse from django.utils import timezone from wagtail.core.models import Page from wagtail.tests.utils import WagtailTestUtils class TestLockedPagesView(TestCase, WagtailTestUtils): def setUp(self): self.user = self.login() def get(self, para...
{ "repo_name": "mixxorz/wagtail", "path": "wagtail/admin/tests/test_reports_views.py", "copies": "3", "size": "1254", "license": "bsd-3-clause", "hash": -4190948760003822600, "line_mean": 34.8285714286, "line_max": 84, "alpha_frac": 0.6929824561, "autogenerated": false, "ratio": 4.250847457627119,...
from django.test import TestCase from django.urls import reverse from django.utils import translation from rdmo.accounts.utils import set_group_permissions class CoreViewTests(TestCase): fixtures = ( 'users.json', 'groups.json', 'accounts.json', ) def setUp(self): transl...
{ "repo_name": "DMPwerkzeug/DMPwerkzeug", "path": "rdmo/core/tests/test_views.py", "copies": "1", "size": "1872", "license": "apache-2.0", "hash": -492781176124344300, "line_mean": 30.7288135593, "line_max": 74, "alpha_frac": 0.6266025641, "autogenerated": false, "ratio": 4.206741573033708, "con...
from django.test import TestCase from django.urls import reverse from imagersite.tests.factories import UserFactory, AlbumFactory, PhotoFactory class PhotoViewTestCase(TestCase): def setUp(self): """ Setup a user, log the user on, create a photo, load the page """ self.user = User...
{ "repo_name": "crashtack/django-imager", "path": "imager_images/tests/test_photo_album_and_library_view.py", "copies": "1", "size": "5406", "license": "mit", "hash": -7847357341848095000, "line_mean": 39.3432835821, "line_max": 78, "alpha_frac": 0.6272660007, "autogenerated": false, "ratio": 4.12...
from django.test import TestCase from django.urls import reverse from rest_framework.test import RequestsClient class TestApiRoot(TestCase): url = reverse('index') def test_allows_unauthenticated(self): response = self.client.get(self.url) self.assertTrue(response.status_code < 400) def...
{ "repo_name": "vsemionov/boomerang", "path": "boomerang/tests/test_apiroot.py", "copies": "1", "size": "1498", "license": "mit", "hash": 2958203299499790300, "line_mean": 35.5365853659, "line_max": 143, "alpha_frac": 0.6895861148, "autogenerated": false, "ratio": 3.9214659685863875, "config_tes...
from django.test import TestCase from django.urls import reverse from taggit.models import Tag from wagtail.core.models import Page from wagtail.tests.utils import WagtailTestUtils from tests.app.models import NewsIndex, NewsItem class TestNewsItemWithTags(TestCase, WagtailTestUtils): def setUp(self): s...
{ "repo_name": "takeflight/wagtailnews", "path": "tests/test_tags.py", "copies": "1", "size": "1457", "license": "bsd-2-clause", "hash": 4673898036990184000, "line_mean": 32.1136363636, "line_max": 80, "alpha_frac": 0.601921757, "autogenerated": false, "ratio": 3.804177545691906, "config_test": ...
from django.test import TestCase from django.urls import reverse from conf_site.accounts.tests import AccountsTestCase from conf_site.core.views import CsvView class CsvViewTestCase(TestCase): view_class = CsvView def test_status_code(self): response = self.view_class().get() self.assertEqua...
{ "repo_name": "pydata/conf_site", "path": "conf_site/core/tests/test_csv_view.py", "copies": "1", "size": "1754", "license": "mit", "hash": 4784193721654503000, "line_mean": 32.0943396226, "line_max": 75, "alpha_frac": 0.6527936146, "autogenerated": false, "ratio": 3.9773242630385486, "config_t...
from django.test import TestCase from django.urls import reverse from devilry.project.develop.testhelpers.corebuilder import UserBuilder # from develop.testhelpers.soupselect import cssFind # from develop.testhelpers.soupselect import cssGet # from develop.testhelpers.soupselect import cssExists from devilry.project.d...
{ "repo_name": "devilry/devilry-django", "path": "devilry/devilry_header/tests/test_aboutme.py", "copies": "1", "size": "2014", "license": "bsd-3-clause", "hash": 3747083714211586000, "line_mean": 40.1020408163, "line_max": 93, "alpha_frac": 0.6504468719, "autogenerated": false, "ratio": 3.9412915...
from django.test import TestCase from django.urls import reverse from mapentity.factories import SuperUserFactory from geotrek.zoning.factories import CityFactory, DistrictFactory, RestrictedAreaFactory from geotrek.zoning.models import City, District, RestrictedArea class ZoningAdminTest(TestCase): @classmetho...
{ "repo_name": "GeotrekCE/Geotrek-admin", "path": "geotrek/zoning/tests/test_admin.py", "copies": "2", "size": "3171", "license": "bsd-2-clause", "hash": -2804910168750332400, "line_mean": 47.0454545455, "line_max": 117, "alpha_frac": 0.6953642384, "autogenerated": false, "ratio": 3.82971014492753...
from django.test import TestCase from django.urls import reverse from .models import GroupType, Group, MemRole, GroupMember from cities_local.models import Country, Region, City from families.models import Family, Member # Create your tests here. class GroupTypeTest(TestCase): def setUp(self): self.group...
{ "repo_name": "pihentagyu/django_chms", "path": "groups/tests.py", "copies": "1", "size": "2276", "license": "bsd-2-clause", "hash": 5085197373748192000, "line_mean": 30.1780821918, "line_max": 64, "alpha_frac": 0.5443760984, "autogenerated": false, "ratio": 4.049822064056939, "config_test": tr...
from django.test import TestCase from django.urls import reverse from my_app.my_app.fixtures.account import art_vandalay from my_app.lib.ttam_api.ttam_api.django.testing import authenticated, mock_ttam_api ACCESSION_LENGTH = 191154276 def get_side_effect(resource, params={}, data={}): if '3/accession' in resou...
{ "repo_name": "ortutay/23andme-phenotypes-hackathon", "path": "my_app/my_app/tests/test_index.py", "copies": "1", "size": "1121", "license": "mit", "hash": 3584713148926582300, "line_mean": 27.025, "line_max": 84, "alpha_frac": 0.6413916146, "autogenerated": false, "ratio": 3.4281345565749235, ...
from django.test import TestCase from django.urls import reverse from test_generator.core import TestModelStringMixin from test_generator.views import TestModelViewMixin, TestViewMixin from rdmo.core.testing.mixins import TestImportViewMixin from rdmo.accounts.utils import set_group_permissions from ..models import ...
{ "repo_name": "DMPwerkzeug/DMPwerkzeug", "path": "rdmo/projects/tests/test_views.py", "copies": "1", "size": "6590", "license": "apache-2.0", "hash": -7526032841584240000, "line_mean": 32.9690721649, "line_max": 104, "alpha_frac": 0.5323216995, "autogenerated": false, "ratio": 3.853801169590643, ...
from django.test import TestCase from django.urls import reverse from userena.tests.profiles.models import Profile class PrivacyTests(TestCase): """ Privacy testing of views concerning profiles. Test the privacy of the views that are available with three type of users: - Anonymous: An user that...
{ "repo_name": "bioinformatics-ua/django-userena", "path": "userena/tests/test_privacy.py", "copies": "1", "size": "2931", "license": "bsd-3-clause", "hash": 5211576423708266000, "line_mean": 30.8586956522, "line_max": 85, "alpha_frac": 0.5735243944, "autogenerated": false, "ratio": 4.065187239944...
from django.test import TestCase from django.urls import reverse from .utils import add_default_data from petition.models import Organization, Petition, PytitionUser class PetitionViewTest(TestCase): """Test index view""" @classmethod def setUpTestData(cls): add_default_data() def tearDown(...
{ "repo_name": "fallen/Pytition", "path": "pytition/petition/tests/tests_PetitionViews.py", "copies": "1", "size": "9437", "license": "bsd-3-clause", "hash": -3261496731938564000, "line_mean": 45.9552238806, "line_max": 112, "alpha_frac": 0.6610151531, "autogenerated": false, "ratio": 3.7612594659...
from django.test import TestCase from django.urls import reverse from .utils import add_default_data from petition.models import Petition, Signature class ConfirmViewTest(TestCase): """Test confirm view""" @classmethod def setUpTestData(cls): add_default_data() def test_ConfirmOk(self): ...
{ "repo_name": "fallen/Pytition", "path": "pytition/petition/tests/tests_Confirm.py", "copies": "1", "size": "1195", "license": "bsd-3-clause", "hash": -748075158923873700, "line_mean": 37.5806451613, "line_max": 103, "alpha_frac": 0.6694560669, "autogenerated": false, "ratio": 4.078498293515358, ...
from django.test import TestCase from django.urls import reverse from wagtail.core.models import Collection from wagtail.documents.models import Document from wagtail.tests.utils import WagtailTestUtils class TestCollectionsIndexView(TestCase, WagtailTestUtils): def setUp(self): self.login() def get...
{ "repo_name": "kaedroho/wagtail", "path": "wagtail/admin/tests/test_collections_views.py", "copies": "7", "size": "8774", "license": "bsd-3-clause", "hash": -447971686607009800, "line_mean": 36.6566523605, "line_max": 120, "alpha_frac": 0.6572828812, "autogenerated": false, "ratio": 4.07903300790...
from django.test import TestCase from django.urls import reverse class HomePageTestCase(TestCase): def setUp(self): self.response = self.client.get(reverse('homepage')) def test_home_page_exists(self): '''assert that the rewpose for the hoepageurl is 200''' self.assertEquals(self.res...
{ "repo_name": "crashtack/django-imager", "path": "imagersite/tests/test_home_page.py", "copies": "1", "size": "1303", "license": "mit", "hash": 5525019600851399000, "line_mean": 38.4848484848, "line_max": 78, "alpha_frac": 0.6715272448, "autogenerated": false, "ratio": 4.059190031152648, "confi...
from django.test import TestCase from django.utils.crypto import get_random_string from zentral.contrib.santa.models import Configuration class SantaConfigurationTestCase(TestCase): def test_local_configuration_url_keys(self): more_info_url = "https://{}.de".format(get_random_string(34)) file_chan...
{ "repo_name": "zentralopensource/zentral", "path": "tests/santa/test_configuration.py", "copies": "1", "size": "3435", "license": "apache-2.0", "hash": -5366620191252610000, "line_mean": 65.0576923077, "line_max": 105, "alpha_frac": 0.6748180495, "autogenerated": false, "ratio": 3.939220183486238...
from django.test import TestCase from django.utils.datastructures import MultiValueDict from .models import AjaxSelect2ModelChoiceField, AjaxSelect2ModelMultipleChoiceField from .widgets import Select2MultipleWidget, AjaxSelect2Widget, AjaxSelect2MultipleWidget class Select2MultipleWidgetTest(TestCase): def test...
{ "repo_name": "ouhouhsami/django-select2light", "path": "select2light/tests.py", "copies": "1", "size": "3765", "license": "apache-2.0", "hash": -8800791994721670000, "line_mean": 46.6582278481, "line_max": 99, "alpha_frac": 0.6772908367, "autogenerated": false, "ratio": 3.7725450901803605, "co...
from django.test import TestCase from django.utils.datastructures import SortedDict from rapidsms.contrib.locations.models import LocationType, Location from survey.templatetags.chart_template_tags import get_computational_value_by_answer class ChartTemplateTagsTest(TestCase): def setUp(self): self.countr...
{ "repo_name": "unicefuganda/mics", "path": "survey/tests/template_tags/test_charts_template_tags.py", "copies": "2", "size": "1522", "license": "bsd-3-clause", "hash": -5050591172935857000, "line_mean": 59.92, "line_max": 108, "alpha_frac": 0.7076215506, "autogenerated": false, "ratio": 3.4512471...
from django.test import TestCase from django.utils.datastructures import SortedDict from pipeline.conf import settings from pipeline.storage import PipelineStorage class StorageTest(TestCase): def setUp(self): settings.PIPELINE_CSS = { 'testing': { 'source_filenames': ( ...
{ "repo_name": "pdr/django-pipeline", "path": "tests/tests/storage.py", "copies": "8", "size": "1370", "license": "mit", "hash": -4245642241349969000, "line_mean": 32.4146341463, "line_max": 66, "alpha_frac": 0.5664233577, "autogenerated": false, "ratio": 4.08955223880597, "config_test": true, ...
from django.test import TestCase from django.utils.dateparse import parse_datetime from django.utils.timezone import make_aware, make_naive, utc class TimeZoneTests(TestCase): """test time zone handling""" def test_conversion(self): input = "2020-02-04T20:34:14Z" parsed = parse_datetime(input...
{ "repo_name": "peeringdb/django-peeringdb", "path": "tests/test_timezone.py", "copies": "1", "size": "1307", "license": "apache-2.0", "hash": -7738468577032089000, "line_mean": 28.0444444444, "line_max": 61, "alpha_frac": 0.6090283091, "autogenerated": false, "ratio": 4.460750853242321, "config...
from django.test import TestCase from django.utils.datetime_safe import datetime, date from moneyed import Money from freezegun import freeze_time from hordak.models.core import Account from hordak.utilities.currency import Balance from swiftwind.billing_cycle.models import BillingCycle from swiftwind.core.management....
{ "repo_name": "adamcharnock/swiftwind", "path": "swiftwind/core/tests_worked_example.py", "copies": "2", "size": "8489", "license": "mit", "hash": 6293814497876217000, "line_mean": 54.1233766234, "line_max": 118, "alpha_frac": 0.6537872541, "autogenerated": false, "ratio": 3.500618556701031, "c...
from django.test import TestCase from django.utils.html import escape from unittest import skip from lists.models import Item, List from lists.forms import ItemForm, ExistingListItemForm, EMPTY_ITEM_ERROR, DUPLICATE_ITEM_ERROR class HomePageTest(TestCase): def test_home_page_renders_home_template(self): ...
{ "repo_name": "benosment/tdd_django", "path": "lists/tests/test_views.py", "copies": "1", "size": "6172", "license": "mit", "hash": 3930610355880918000, "line_mean": 39.880794702, "line_max": 94, "alpha_frac": 0.6207064161, "autogenerated": false, "ratio": 3.8004926108374386, "config_test": tru...
from django.test import TestCase from django.utils import simplejson from reviewboard.hostingsvcs.models import HostingServiceAccount from reviewboard.hostingsvcs.service import get_hosting_service from reviewboard.scmtools.models import Repository class ServiceTests(TestCase): service_name = None def __ini...
{ "repo_name": "atagar/ReviewBoard", "path": "reviewboard/hostingsvcs/tests.py", "copies": "1", "size": "21038", "license": "mit", "hash": -1191203556692009200, "line_mean": 40.8250497018, "line_max": 80, "alpha_frac": 0.6100389771, "autogenerated": false, "ratio": 4.041106415674222, "config_tes...
from django.test import TestCase from django.utils import six from ..bin.start_cms_project import (Output, git, make_executable, query_yes_no, configure_apps, main) import getpass try: from unittest import mock from unittest.mock import call except ImportError: import ...
{ "repo_name": "danielsamuels/cms", "path": "cms/tests/test_start_cms_project.py", "copies": "2", "size": "12858", "license": "bsd-3-clause", "hash": -7179372683597793000, "line_mean": 37.497005988, "line_max": 156, "alpha_frac": 0.5398195676, "autogenerated": false, "ratio": 3.6281038374717833, ...
from django.test import TestCase from django.utils import six from .. import utils from ..views import IndexView from .models import UtilsTestModel class UtilsTest(TestCase): def setUp(self): self.instance = UtilsTestModel() def test_as_model_class(self): self.assertEquals( Util...
{ "repo_name": "andrewsmedina/django-admin2", "path": "djadmin2/tests/test_utils.py", "copies": "1", "size": "4770", "license": "bsd-3-clause", "hash": 5014400021265267000, "line_mean": 29.1898734177, "line_max": 84, "alpha_frac": 0.5769392034, "autogenerated": false, "ratio": 4.122731201382887, ...
from django.test import TestCase from django.utils import six from oscar.apps.offer import custom, models from oscar.apps.basket.models import Basket from oscar.test import factories class TestConditionProxyModels(TestCase): def test_name_and_description(self): """ Tests that the condition proxy...
{ "repo_name": "itbabu/django-oscar", "path": "tests/unit/offer/condition_tests.py", "copies": "13", "size": "1889", "license": "bsd-3-clause", "hash": -4441755362754091000, "line_mean": 32.1403508772, "line_max": 77, "alpha_frac": 0.677077819, "autogenerated": false, "ratio": 4.2071269487750556, ...
from django.test import TestCase from django.utils import timezone from core import factories class TopicModelTests(TestCase): def setUp(self): super(TopicModelTests, self).setUp() self.topic = factories.TopicFactory.create() def tearDown(self): super(TopicModelTests, self)...
{ "repo_name": "anehx/anonboard-backend", "path": "core/tests/test_models.py", "copies": "1", "size": "1852", "license": "mit", "hash": -1144237913870561400, "line_mean": 23.3684210526, "line_max": 73, "alpha_frac": 0.6133909287, "autogenerated": false, "ratio": 4.133928571428571, "config_test":...
from django.test import TestCase from django.utils import timezone from django.contrib.auth.models import User from django.shortcuts import reverse from django.http import Http404 from django.contrib.sites.models import Site import datetime from unittest import mock from allauth.socialaccount.models import SocialApp,...
{ "repo_name": "caleblogan/twitter-scheduler", "path": "twitterscheduler/tests/test_tasks.py", "copies": "1", "size": "8780", "license": "mit", "hash": 2890281427580092400, "line_mean": 46.9781420765, "line_max": 132, "alpha_frac": 0.6749430524, "autogenerated": false, "ratio": 3.267584666914775, ...
from django.test import TestCase from django.utils import timezone from django.core.urlresolvers import reverse from .models import Question import datetime # What happened is this: # python manage.py test polls looked for tests in the polls application # it found a subclass of the django.test.TestCase class # it cr...
{ "repo_name": "patsoncy/topnews", "path": "polls/tests.py", "copies": "1", "size": "2925", "license": "mit", "hash": 2893151050087252000, "line_mean": 42.6567164179, "line_max": 116, "alpha_frac": 0.7025641026, "autogenerated": false, "ratio": 3.848684210526316, "config_test": true, "has_no_k...
from django.test import TestCase from django.utils import timezone from django.core.urlresolvers import reverse import datetime from random import random from slave.models import Slave, SlaveManager, RaceDefaults #from skill.models import Skill, SkillTrained #from task.farming import Plant from slave.settings import ...
{ "repo_name": "ngr/sm_00", "path": "slave/helpers_test.py", "copies": "1", "size": "1725", "license": "mit", "hash": -8267213778857372000, "line_mean": 28.2372881356, "line_max": 79, "alpha_frac": 0.6649275362, "autogenerated": false, "ratio": 3.3045977011494254, "config_test": false, "has_no...
from django.test import TestCase from django.utils import timezone from django.db import IntegrityError from django.core.exceptions import MultipleObjectsReturned from core.tests.mommy_utils import make_recipe, make_user from timer.models import Timer class RunningTimerManagerTestCase(TestCase): def test_query_...
{ "repo_name": "ministryofjustice/cla_backend", "path": "cla_backend/apps/timer/tests/test_managers.py", "copies": "1", "size": "1542", "license": "mit", "hash": 4891601974149628000, "line_mean": 35.7142857143, "line_max": 95, "alpha_frac": 0.682230869, "autogenerated": false, "ratio": 3.864661654...