# Path: testing/factories/employee.py
# def create_employee(
#     username='johndoe',
#     department='Engineering',
#     first_name='John',
#     last_name='Doe',
#     photo_url=None,
#     office=None,
# ):
# 
#     if photo_url is None:
#         photo_url = 'http://example.com/photos/{0}.jpg'.format(username)
# 
#     return Employee.create_from_dict({
#         'username': username,
#         'department': department,
#         'first_name': first_name,
#         'last_name': last_name,
#         'photo_url': photo_url,
#         'office': office,
#     })


import mock
import os
import unittest
import main
from flask_themes2 import Themes, load_themes_from
from flask_webtest import TestApp
from testing.factories import create_employee
        self.assertIsNotNone(form.get('_csrf_token'))
        self.assertEqual(
            form['_csrf_token'].value, session['_csrf_token'],
        )

    def addCsrfTokenToSession(self):
        csrf_token = 'MY_TOKEN'
        with self.app.session_transaction() as session:
            session['_csrf_token'] = csrf_token
        return csrf_token


class LoggedInUserBaseTest(YelpLoveTestCase):

    nosegae_datastore_v3 = True
    nosegae_datastore_v3_kwargs = {
        'datastore_file': '/tmp/nosegae.sqlite3',
        'use_sqlite': True
    }

    nosegae_user = True
    nosegae_user_kwargs = dict(
        USER_ID='johndoe',
        USER_EMAIL='johndoe@example.com',
        USER_IS_ADMIN='0',
    )

    @mock.patch('models.employee.config')
    def setUp(self, mock_config):
        mock_config.DOMAIN = 'example.com'

# Path: testing/factories/employee.py
# def create_employee(
#     username='johndoe',
#     department='Engineering',
#     first_name='John',
#     last_name='Doe',
#     photo_url=None,
#     office=None,
# ):
# 
#     if photo_url is None:
#         photo_url = 'http://example.com/photos/{0}.jpg'.format(username)
# 
#     return Employee.create_from_dict({
#         'username': username,
#         'department': department,
#         'first_name': first_name,
#         'last_name': last_name,
#         'photo_url': photo_url,
#         'office': office,
#     })


# Path: testing/util.py
import mock
import os
import unittest
import main
from flask_themes2 import Themes, load_themes_from
from flask_webtest import TestApp
from testing.factories import create_employee

        self.assertIsNotNone(form.get('_csrf_token'))
        self.assertEqual(
            form['_csrf_token'].value, session['_csrf_token'],
        )

    def addCsrfTokenToSession(self):
        csrf_token = 'MY_TOKEN'
        with self.app.session_transaction() as session:
            session['_csrf_token'] = csrf_token
        return csrf_token


class LoggedInUserBaseTest(YelpLoveTestCase):

    nosegae_datastore_v3 = True
    nosegae_datastore_v3_kwargs = {
        'datastore_file': '/tmp/nosegae.sqlite3',
        'use_sqlite': True
    }

    nosegae_user = True
    nosegae_user_kwargs = dict(
        USER_ID='johndoe',
        USER_EMAIL='johndoe@example.com',
        USER_IS_ADMIN='0',
    )

    @mock.patch('models.employee.config')
    def setUp(self, mock_config):
        mock_config.DOMAIN = 'example.com'

        self.current_user = create_employee(username='johndoe')