def test_getProfilefromUsername(self):
        """
        """
        self.assertEqual(self.getProfile,
                         profUtils.getProfileFromUsername("ben"))

        print(profUtils.getProfileFromUsername("ben").user.first_name)
Exemple #2
0
 def setUp(self):
     self.genBorrowReq = actUtils.createBorrowRequestAction(
         Tool.objects.get(name="Hoe"),
         profUtils.getProfileFromUsername("TaikhoomAttar"))
     self.genJoinReq = actUtils.createShedRequestAction(
         Shed.objects.get(name="Taikhoom's Shed"),
         profUtils.getProfileFromUsername("TaikhoomAttar"))
Exemple #3
0
 def test_AllProfileNotifs(self):
     """
     """
     self.assertIn(
         self.genInfoNotif,
         notifUtils.getAllProfileNotifs(
             profUtils.getProfileFromUsername("TaikhoomAttar")))
Exemple #4
0
 def test_AllActivrProfileNotifs(self):
     """
     THIS NEEDS TO BE MODIFIED FOR RESPONSE NOTIFICATIONS
     """
     self.assertIn(
         self.genInfoNotif,
         notifUtils.getAllActiveProfileNotifs(
             profUtils.getProfileFromUsername("TaikhoomAttar")))
Exemple #5
0
 def setUp(self):
     try:
         self.genInfoNotif = notifUtils.createInfoNotif(
             Tool.objects.get(name="Hoe"),
             profUtils.getProfileFromUsername("TaikhoomAttar"),
             "Synergy is love, synergy is life")
     except:
         self.fail("Error in info notification generation!")
	def test_notif_creation (self):
		"""
		"""
		tool = Tool.objects.get(name = "Hoe")
		#print (tool.name)
		prof = profUtils.getProfileFromUsername ("TaikhoomAttar")
		msg = "Synergy is love, synergy is life"
		generation = notifUtils.createInfoNotif (tool, prof, msg)
		self.assertEqual (tool, generation.source)
		self.assertEqual (prof, generation.recipient)
		self.assertEqual (msg, generation.content)
	def test_getProfileAction (self):
		self.assertTrue ((self.genBorrowReq in actUtils.getProfileAction(profUtils.getProfileFromUsername ("TaikhoomAttar")))\
		 and (self.genJoinReq in actUtils.getProfileAction(profUtils.getProfileFromUsername ("TaikhoomAttar"))))
	def setUp (self):
		self.genBorrowReq = actUtils.createBorrowRequestAction (Tool.objects.get (name = "Hoe"), profUtils.getProfileFromUsername ("TaikhoomAttar"))
		self.genJoinReq = actUtils.createShedRequestAction (Shed.objects.get (name = "Taikhoom's Shed"), profUtils.getProfileFromUsername ("TaikhoomAttar"))
 def test_getProfilefromUsername (self):
     """
     """
     self.assertEqual (self.getProfile, profUtils.getProfileFromUsername ("ben"))
     
     print (profUtils.getProfileFromUsername ("ben").user.first_name)
Exemple #10
0
 def test_getNotifRecipient(self):
     """
     """
     self.assertEquals(profUtils.getProfileFromUsername("TaikhoomAttar"),
                       notifUtils.getNotifRecip(self.genInfoNotif))
Exemple #11
0
	def test_shed_joining_other (self):
		self.selenium.get (self.live_server_url + "/sheds/1/join/")
		
		#self.selenium.find_element_by_xpath("//button[contains(.,'Join this shed')]").click()
		
		self.assertIn (profUtils.getProfileFromUsername ("TaikhoomAttar"), Shed.objects.get (name = "Jake's Shed").members.all())
Exemple #12
0
 def test_getProfileAction(self):
     self.assertTrue ((self.genBorrowReq in actUtils.getProfileAction(profUtils.getProfileFromUsername ("TaikhoomAttar")))\
      and (self.genJoinReq in actUtils.getProfileAction(profUtils.getProfileFromUsername ("TaikhoomAttar"))))
Exemple #13
0
 def test_getNotifRecipient (self):
     """
     """
     self.assertEquals (profUtils.getProfileFromUsername ("TaikhoomAttar"), notifUtils.getNotifRecip (self.genInfoNotif))
Exemple #14
0
 def test_AllActivrProfileNotifs (self):
     """
     THIS NEEDS TO BE MODIFIED FOR RESPONSE NOTIFICATIONS
     """
     self.assertIn (self.genInfoNotif, notifUtils.getAllActiveProfileNotifs (profUtils.getProfileFromUsername ("TaikhoomAttar")))
Exemple #15
0
 def test_AllProfileNotifs (self):
     """
     """
     self.assertIn (self.genInfoNotif, notifUtils.getAllProfileNotifs (profUtils.getProfileFromUsername ("TaikhoomAttar")))
Exemple #16
0
 def setUp (self):
     try:
     	self.genInfoNotif = notifUtils.createInfoNotif (Tool.objects.get(name = "Hoe"), profUtils.getProfileFromUsername ("TaikhoomAttar"), "Synergy is love, synergy is life")
     except:
     	self.fail ("Error in info notification generation!")