-
Notifications
You must be signed in to change notification settings - Fork 0
/
factories.py
56 lines (42 loc) · 1.67 KB
/
factories.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import factory
import factory.alchemy
import factory.fuzzy
import datetime
import pytz
import models
from app import app, db
class FireIncidentFactory(factory.alchemy.SQLAlchemyModelFactory):
class Meta:
model = models.FireIncident
sqlalchemy_session = db.session
cad_call_number = factory.Sequence(lambda n: n)
alarm_datetime = factory.fuzzy.FuzzyDateTime(
datetime.datetime(2013, 1, 1, tzinfo=pytz.utc))
class StandardizedFireIncidentFactory(factory.alchemy.SQLAlchemyModelFactory):
class Meta:
model = models.StandardizedFireIncident
sqlalchemy_session = db.session
cad_call_number = factory.Sequence(lambda n: n)
alarm_datetime = factory.fuzzy.FuzzyDateTime(
datetime.datetime(2013, 1, 1, tzinfo=pytz.utc))
class PoliceIncidentFactory(factory.alchemy.SQLAlchemyModelFactory):
class Meta:
model = models.PoliceIncident
sqlalchemy_session = db.session
cad_call_number = factory.Sequence(lambda n: "L%d" % n)
class StandardizedPoliceIncidentFactory(factory.alchemy.SQLAlchemyModelFactory):
class Meta:
model = models.StandardizedPoliceIncident
sqlalchemy_session = db.session
cad_call_number = factory.Sequence(lambda n: "L%d" % n)
class BusinessLicenseFactory(factory.alchemy.SQLAlchemyModelFactory):
class Meta:
model = models.BusinessLicense
sqlalchemy_session = db.session
name = factory.fuzzy.FuzzyText()
class UserFactory(factory.alchemy.SQLAlchemyModelFactory):
class Meta:
model = models.User
sqlalchemy_session = db.session
email = factory.fuzzy.FuzzyText(suffix='@example.org')
name = factory.fuzzy.FuzzyText()