Exemple #1
0
    def _create_projects(self):
        """
        """

        count = randint(5, 10)
        for i in range(count):
            ProjectFactory.create(
                tags=(self.tags[i] for i in range(randint(1, 10))))

        print("Created {0} Projects".format(count))
Exemple #2
0
    def _create_projects(self):
        """
        """

        count = randint(5, 10)
        for i in range(count):
            ProjectFactory.create(tags=(self.tags[i]
                                        for i in range(randint(1, 10))))

        print("Created {0} Projects".format(count))
def test_create_buy_form():
    project = ProjectFactory.create()
    procurement_method = ProcurementMethodFactory.create()
    data = {
        "name": "New Buy",
        "description": "This is a new buy for things",
        "budget": 50,
        "project": project.id,
        "procurement_method": procurement_method.id
    }
    form = CreateBuyForm(data)
    assert form.is_valid(), form.errors
Exemple #4
0
 def setUp(self):
     self.project = ProjectFactory.create()
Exemple #5
0
    def test_project_unique_title(self):
        project_b = ProjectFactory.create(title="other title")
        project_b.title = self.project.title

        with self.assertRaises(IntegrityError):
            project_b.save()
Exemple #6
0
 def setUp(self):
     self.project = ProjectFactory.create()
     self.content_type = ContentType.objects.get(app_label='projects',
                                                 model='project')
 def test_budget(self):
     project = ProjectFactory.create(
         cogs_amount=75,
         non_cogs_amount=25,
     )
     assert project.budget() == 100
 def test_budget_remaining_clean(self):
     project = ProjectFactory.create(non_cogs_amount=200)
     buy = BuyFactory.create(budget=150,
                             project=project,
                             public=project.public)
     buy.full_clean()
 def test_budget_remaining(self):
     project = ProjectFactory.create(non_cogs_amount=200, cogs_amount=0)
     buy = BuyFactory.create(budget=50, project=project)
     assert project.budget_remaining() == 150
     buy2 = BuyFactory.create(budget=50, project=project)
     assert project.budget_remaining() == 100