def create_project(self): u = User(email="*****@*****.**", name="what", slug="hahah") u.save() n = Nonprofit(user=u, name="hahah") n.save() from random import randint random = randint(1, 100) project = Project(nonprofit=n, name='name' + str(random)) project.nonprofit = n project.save() project.job = Job(start_date=datetime.now().replace( tzinfo=pytz.timezone("America/Sao_Paulo")), end_date=datetime.now().replace( tzinfo=pytz.timezone("America/Sao_Paulo"))) project.job.save() return project