Ejemplo n.º 1
0
 def test_project_creation(self):
     """ Projects are the primary unit of gus
 users will need to create projects
 """
     self.assertEqual(Project.objects.all().count(), 0)
     project = Project()
     project.name = "sdn32"
     project.save()
     project.full_clean()
     self.assertEqual(Project.objects.all().count(), 1)
Ejemplo n.º 2
0
 def test_project_creation(self):
     ''' Projects are the primary unit of gus
 users will need to create projects
 '''
     self.assertEqual(Project.objects.all().count(), 0)
     project = Project()
     project.name = "sdn32"
     project.save()
     project.full_clean()
     self.assertEqual(Project.objects.all().count(), 1)
Ejemplo n.º 3
0
import csv
with open('NRI_active_projects.txt', newline='') as f:
    reader = csv.reader(f)
    for row in reader:
        a = Account.objects.filter(label=row[1])
        if (a.count() == 1):
            """ account exists """
            acc = a.last()
            f = acc.funds.filter(label=str(row[2].zfill(5)))

            if (f.count() == 1):
                """ fund exists """
                """ MAKE the project """
                p = Project()
                p.fund = f
                p.name = "sdn32"
                p.full_clean()
                p.save()
            else:
                error(
                    "[" + row[0] + "] fund(" + row[2] +
                    ") does not exist on the account (" + row[1] + ")",
                    f.count())

        else:
            """ account does not exist"""
            error("account (" + row[2] + ")", a.count())

#        print(row[4], ' ', row[1],'-',row[2].zfill(5), ' ', row[0], sep='')
        """ 
      look up account
Ejemplo n.º 4
0
import csv
with open('NRI_active_projects.txt', newline='') as f:
    reader = csv.reader(f)
    for row in reader:
      a = Account.objects.filter(label=row[1])
      if(a.count() == 1):
        """ account exists """
        acc= a.last()
        f = acc.funds.filter(label=str(row[2].zfill(5)))

        if(f.count() == 1):
          """ fund exists """
          """ MAKE the project """
          p = Project()
          p.fund=f
          p.name="sdn32"
          p.full_clean()
          p.save()
        else:
          error("["+row[0]+"] fund("+row[2]+") does not exist on the account ("+row[1]+")" ,f.count())

      else:
        """ account does not exist"""
        error("account ("+row[2]+")",a.count())

#        print(row[4], ' ', row[1],'-',row[2].zfill(5), ' ', row[0], sep='')


      """ 
      look up account
      does it have a matching fund?