This file contains hidden or 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 urllib2 | |
from datalibs import app | |
import unittest | |
from flask import Flask | |
from flask.ext.testing import LiveServerTestCase | |
class MyTest(LiveServerTestCase): | |
def create_app(self): | |
app.config['TESTING'] = True |
This file contains hidden or 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 os | |
from datalibs import app | |
import unittest | |
class AppViewTestCase(unittest.TestCase): | |
def setUp(self): | |
app.config['TESTING'] = True | |
self.app = app.test_client() | |
def tearDown(self): |
This file contains hidden or 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
def send_email( gmail_user, gmail_pwd, mail_from, mail_to, title, message ): | |
import smtplib | |
# Prepare actual message | |
message = """\From: %s\nTo: %s\nSubject: %s\n\n%s | |
""" % (mail_from, ", ".join(mail_to), title, message) | |
try: | |
#server = smtplib.SMTP(SERVER) | |
server = smtplib.SMTP("smtp.gmail.com", 587) #or port 465 doesn't seem to work! | |
server.ehlo() |
NewerOlder