Пример #1
0
    def setUp(self):
        self.status1 = CompanyStatusFactory()
        self.company1 = CompanyFactory(companyStatus=self.status1)

        self.card1 = CardFactory(company=self.company1,
                                 phase=PHASE_CHOICES[1][1],
                                 state=False)
Пример #2
0
    def setUp(self):
        self.status1 = CompanyStatusFactory()
        self.company1 = CompanyFactory(companyStatus = self.status1)

        self.card1 = CardFactory(company=self.company1,
                                 phase=PHASE_CHOICES[1][1],
                                 state=False)
Пример #3
0
    def setUp(self):
        settings.EMAIL_BACKEND = \
            'django.core.mail.backends.locmem.EmailBackend'

        self.founder = FounderFactory()
        self.mentor = MentorFactory()
        self.staff = StaffUserProfileFactory()
        self.executive = ExecutiveUserProfileFactory()

        self.founderCompany = FounderFactory()
        self.mentorCompany = MentorFactory()
        self.status = CompanyStatusFactory()
        self.company = CompanyFactory(companyStatus=self.status)
        self.company.founders.add(self.founderCompany)
        self.company.mentors.add(self.mentorCompany)
        self.company.save()

        self.card = CardFactory(company=self.company,
                                phase=PHASE_CHOICES[0][1],
                                state=False)
Пример #4
0
class CardModelsTest(TestCase):
    def setUp(self):
        self.status1 = CompanyStatusFactory()
        self.company1 = CompanyFactory(companyStatus=self.status1)

        self.card1 = CardFactory(company=self.company1,
                                 phase=PHASE_CHOICES[1][1],
                                 state=False)

    def test_is_past_due(self):
        self.assertEqual(False, self.card1.is_past_due())
        self.card1.deadline = datetime.date.today()
        self.assertEqual(False, self.card1.is_past_due())
        self.card1.deadline = datetime.date(2015, 01, 01)
        self.assertEqual(True, self.card1.is_past_due())

    def test_change_phase(self):
        self.card1.change_phase(PHASE_CHOICES[0][1])
        self.assertEqual(PHASE_CHOICES[0][1], self.card1.phase)
        self.card1.change_phase(PHASE_CHOICES[1][1])
        self.assertEqual(PHASE_CHOICES[1][1], self.card1.phase)
Пример #5
0
class CardModelsTest(TestCase):

    def setUp(self):
        self.status1 = CompanyStatusFactory()
        self.company1 = CompanyFactory(companyStatus = self.status1)

        self.card1 = CardFactory(company=self.company1,
                                 phase=PHASE_CHOICES[1][1],
                                 state=False)

    def test_is_past_due(self):
        self.assertEqual(False, self.card1.is_past_due())
        self.card1.deadline = datetime.date.today()
        self.assertEqual(False, self.card1.is_past_due())
        self.card1.deadline =datetime.date(2015, 01, 01)
        self.assertEqual(True, self.card1.is_past_due())

    def test_change_phase(self):
        self.card1.change_phase(PHASE_CHOICES[0][1])
        self.assertEqual(PHASE_CHOICES[0][1], self.card1.phase)
        self.card1.change_phase(PHASE_CHOICES[1][1])
        self.assertEqual(PHASE_CHOICES[1][1], self.card1.phase)