예제 #1
0
파일: ch5_db.py 프로젝트: vergiliu/python
 def test_add_employee(self):
     new_employee = Employees(self.connection)
     new_employee.add_employee('Test', 'Employee', date.today())
     cursor = self.connection.cursor()
     cursor.execute('''select * from employees''')
     self.assertEqual(tuple(cursor),
                      (('John', 'Smith', date(year=2013, month=7, day=12)),
                       ('Jane', 'Doe', date(year=2011, month=3, day=11)),
                       ('Test', 'Employee', date.today())))
예제 #2
0
from functions import Functions
from user import User
from log import Log
from employees import Employees
from notifications import Notification
from purchase_request import PurchaseRequest
from abstract_of_canvass import AbstractOfCanvass
from suppliers import Suppliers
from property_acc_receipt import PropertyAcceptanceReceipt
from key_positions import KeyPositions

f = Functions()
u = User()
l = Log()
e = Employees()
n = Notification()
preq = PurchaseRequest()
abc = AbstractOfCanvass()
supp = Suppliers()
prop = PropertyAcceptanceReceipt()
kp = KeyPositions()


def index(request):

    loopRef = genLoopRangeString(5, [('rr', 'tt', 'yy', 'uu'),
                                     ('ii', 'qq', 'ww'), ('ss', 'dd')])
    return setReponse(request, 'non_requisitioner/index.html',
                      [('rr', 'tt', 'yy', 'uu'), ('ii', 'qq', 'ww'),
                       ('ss', 'dd')], [
예제 #3
0
파일: main.py 프로젝트: Megraohoh/classes
from company import Company
from employees import Employees

green_co = Company("Green", "14-Aug-2016")
print(green_co.company_name)

employee_jenny = Employees("Jenny", "accountant", "14-Aug-2016")
employee_tom = Employees("Tom", "hit_man", "14-Aug-2016")
employee_elizabeth = Employees("Elizabeth", "snitch", "14-Aug-2016")
print(employee_jenny.employee_name, employee_tom.employee_name,
      employee_elizabeth.employee_name)
예제 #4
0
파일: ch5_db.py 프로젝트: vergiliu/python
 def test_find_employee(self):
     new_employee = Employees(self.connection)
     found = tuple(new_employee.find_employees_by_name('John', 'Smith'))
     expected = (('John', 'Smith', date(year=2013, month=7, day=12)),)  # expecting single element tuple
     self.assertEqual(found, expected)
예제 #5
0
def get_employees_collection(reqid):
    return Proxy(Employees(), reqid)