Skip to content

Instantly share code, notes, and snippets.

View Tyrdall's full-sized avatar

Tobias Lorenz Tyrdall

View GitHub Profile
@Tyrdall
Tyrdall / mixins.py
Created March 7, 2019 11:12
Django test mixin for views tests
"""Generally useful mixins for tests."""
from django.contrib.auth.models import AnonymousUser
from django.http import Http404
from django.test import RequestFactory
from django.urls import resolve
from django.urls.exceptions import Resolver404
class ViewTestMixin(object):
"""Mixin with shortcuts for view tests."""
"""
- Add some settings -
Log in to your sandbox account and get your API keys plus your merchant ID.
"""
BRAINTREE_PRODUCTION = False # We'll need this later to switch between the sandbox and live account
BRAINTREE_MERCHANT_ID = “your_merchant_id”
BRAINTREE_PUBLIC_KEY = “your_public_key”
BRAINTREE_PRIVATE_KEY = “your_private_key”