Skip to content

Instantly share code, notes, and snippets.

@mekhami
mekhami / gist:d996f2a53c470085cab9fc85f2ed1231
Created September 16, 2019 23:04 — forked from pablorecio/gist:7022796
Example TestCase for unit test Django middlewares
from django.test import RequestFactory, TestCase
from myapp.middleware import MyMiddleware
class MyMiddlewareTestCase(TestCase):
def setUp(self):
super(MyMiddlewareTestCase, self).setUp()
self.factory = RequestFactory()
@mekhami
mekhami / test3.js
Last active December 20, 2016 02:34 — forked from dj-amadeous/test3.js
//Setup
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
from classes import worker
from pages.frontend import ArticlePage
from classes import seleniumDriver
import time,datetime,unittest,sys
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from classes import PageActions as pgactions
from configobj import ConfigObj
from pages.backend import AddArticlePage as AP
import smtplib
import sys, argparse
import re
import base64
import os
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
def banner():
print "#################################"
import smtplib
import sys, argparse
import re
import base64
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
def banner():
print "#################################"
print "# PyPhisher #"
import smtplib
import sys, argparse
import re
import base64
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
def banner():
print "#################################"
print "# PyPhisher #"