This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, json | |
class BulutfonClient(object): | |
def __init__(self, key, sms_title): | |
self.key = key | |
self.sms_title = sms_title | |
self.SMS_ENDPOINT = "https://api.bulutfon.com/messages" | |
def send_transactional_sms(self, to_number, text): | |
data = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from django.shortcuts import redirect | |
from django.http import HttpResponse | |
import requests, hashlib, base64, time | |
EST_MERCHANT_ID = "400000200" | |
EST_3D_KEY = "TRPS0200" | |
EST_RETURN_URL = "http://test.domain.com/basarili" | |
EST_FAIL_URL = "http://test.domain.com/basarisiz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.utils import unittest | |
from django.test.client import RequestFactory | |
class SimpleTest(unittest.TestCase): | |
def setUp(self): | |
# Every test needs access to the request factory. | |
self.factory = RequestFactory() | |
def test_details(self): | |
# Create an instance of a GET request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyTest(TestCase): | |
def setUp(self): | |
self.request_headers = { 'HTTP_HOST': 'subdomain.domain.com' } | |
def test_header(self): | |
client = Client() | |
client.get('path', **self.request_headers) |