class ProductPrice(testdata.DictFactory): product_price_id = testdata.RandomInteger(100, 115) product_id = testdata.RandomInteger(60, 99) # seller_id = testdata.RandomInteger(1, 15) price = testdata.RandomFloat(10.0, 1000.0) register_on = testdata.RandomDateFactory( datetime.datetime(2018, 10, 1, 1, 1, 0, 0), datetime.datetime.now())
class Record(testdata.DictFactory): class info(testdata.DictFactory): employeeid = testdata.RandomInteger(500, 50000) type = testdata.RandomSelection(['full-time', 'part-time']) record_id = testdata.CountingFactory(10) firstname = testdata.FakeDataFactory('firstName') lastname = testdata.FakeDataFactory('lastName') address = testdata.FakeDataFactory('address') age = testdata.RandomInteger(10, 30) gender = testdata.RandomSelection(['female', 'male'])
class PayloadFactory(testdata.DictFactory): iat = testdata.Constant(now()) exp = testdata.RandomInteger(int(now() + 15), int(now() * 2)) iss = testdata.Constant(u'aap.ebi.ac.uk') sub = testdata.Sum([ testdata.Constant(u'usr-'), testdata.HashHexDigestFactory(hashlib.md5) ]) email = testdata.FakeDataFactory(u'email') name = testdata.FakeDataFactory(u'name') nickname = testdata.HashHexDigestFactory(hashlib.sha256) domains = testdata.Constant([])
class Users(testdata.DictFactory): SAT_math = testdata.RandomInteger(200, 800) SAT_read = testdata.RandomInteger(200, 800) SAT_write = testdata.RandomInteger(200, 800) academic_preference = testdata.RandomInteger(1, 5) cost_preference = testdata.RandomInteger(1, 5) degree = testdata.RandomSelection( ['Associate', 'Bachelor', 'Master', 'No Preference']) distance_preference = testdata.RandomInteger(1, 5) dorm_price = random.choice([5000, 10000, 15000, 20000]) email = testdata.FakeDataFactory('email') f_name = testdata.FakeDataFactory('firstName') gpa = testdata.RandomInteger(65, 100) l_name = testdata.FakeDataFactory('lastName') address = testdata.FakeDataFactory('address') tuition = random.choice([5000, 10000, 20000, 30000, 50000, 100000])
class Users(testdata.DictFactory): firstname = testdata.FakeDataFactory('firstName') lastname = testdata.FakeDataFactory('lastName') age = testdata.RandomInteger(100, 300) gender = testdata.RandomSelection(['female', 'male'])
class Users(testdata.DictFactory): custid = testdata.RandomInteger(1, 10) amount = testdata.RandomInteger(1, 100) gateway = testdata.RandomSelection( ['visa', 'paypal', 'master', 'stripe', 'wallet'])
class info(testdata.DictFactory): employeeid = testdata.RandomInteger(500, 50000) type=testdata.RandomSelection(['full-time', 'part-time'])
class Transaction(testdata.DictFactory): id = testdata.CountingFactory(1518144480) account = testdata.RandomSelection(['*****@*****.**']) item = testdata.RandomSelection(ITEMS) quantity = testdata.RandomInteger(1, 3)
exp = testdata.RandomInteger(int(now() + 15), int(now() * 2)) iss = testdata.Constant(u'aap.ebi.ac.uk') sub = testdata.Sum([ testdata.Constant(u'usr-'), testdata.HashHexDigestFactory(hashlib.md5) ]) email = testdata.FakeDataFactory(u'email') name = testdata.FakeDataFactory(u'name') nickname = testdata.HashHexDigestFactory(hashlib.sha256) domains = testdata.Constant([]) payloadValidity = [ (u'There is absolutely no cause for alarm', PayloadFactory(), True), (u'Expired', PayloadFactory(iat=testdata.RandomInteger(0, now() - 3600), exp=testdata.RandomInteger(now() - 3600, now() - 1)), False), (u'No expiration', PayloadFactory(exp=testdata.Constant(None)), False), # Standard says iat should be a number, shouldn't care when it's issued # yay for sanity checks, I guess (u'Back to the future', PayloadFactory(iat=testdata.RandomInteger(now() + 3600, now() * 2), exp=testdata.RandomInteger(now() * 2 + 1, now() * 3)), True), (u'No issue time', PayloadFactory(iat=testdata.Constant(None)), False), (u'Untrusted issuer', PayloadFactory(iss=testdata.FakeDataFactory(u'address')), True), (u'Untrusted issuer', PayloadFactory(iss=testdata.Constant(None)), True),
class ProductReviews(testdata.DictFactory): product_review_id = testdata.RandomInteger(700, 730) product_id = testdata.RandomInteger(60, 100) review_score = testdata.RandomInteger(1, 10)
class OrderDetails(testdata.DictFactory): order_detail_id = testdata.RandomInteger(600, 630)
class Orders(testdata.DictFactory): order_id = testdata.RandomInteger(500, 530) customer_id = testdata.RandomInteger(300, 330)
class Customer(testdata.DictFactory): customer_id = testdata.RandomInteger(300, 330) first_name = testdata.FakeDataFactory('firstName') last_name = testdata.FakeDataFactory('lastName')
class Products(testdata.DictFactory): product_id = testdata.RandomInteger(60, 100) product_name = testdata.RandomSelection(products.keys()) seller_id = testdata.RandomInteger(1, 15)