Example #1
0
 def test_UpdateAddress(self):
     """
     """
     profUtils.updateAddress(self.getProfile,
                             "Hut, Dune Sea, near Mos Eisley, Tatooine")
     self.assertEqual(profUtils.getAddress(self.getProfile),
                      "Hut, Dune Sea, near Mos Eisley, Tatooine")
Example #2
0
def view_current_profile(request, contextArg):
    """this view displays account information and allows users to edit their information
    """
    if request.user.is_anonymous():
        #tell user they need to be logged in to do that
        return HttpResponseRedirect('/accounts/login/') #redirect to login page
    else:
        currentUser = request.user
        userProfile = profileUtil.getProfileFromUser(currentUser)
        print(userProfile.personalShed)
        reputation = profileUtil.getReputation(userProfile)
        timeCreated = userProfile.timeCreated
        streetAddress = profileUtil.getAddress(userProfile)
        city = profileUtil.getCity(userProfile)
        state = profileUtil.getStateName(userProfile)
        shareZone = profileUtil.getSharezone(userProfile)
        context = {}
        context.update(csrf(request))
        context['userProfile'] = userProfile
        context['timeStamp'] = timeCreated
        context['streetAddress'] = streetAddress
        context['reputation'] = reputation
        context['city'] = city
        context['state'] = state
        context['sharezone'] = shareZone
        context.update(content.genBaseLoggedIn(request))
        if contextArg:
            context.update(contextArg)
        return render_to_response('my_account.html', context)
 def test_UpdateAddress(self):
     """
     """
     profUtils.updateAddress(self.getProfile, "Hut, Dune Sea", "Mos Eisley",
                             "Tatooine", "Sandpeople")
     self.assertEqual(profUtils.getAddress(self.getProfile),
                      "Hut, Dune Sea")
Example #4
0
def view_current_profile(request, contextArg):
    """this view displays account information and allows users to edit their information
    """
    if request.user.is_anonymous():
        #tell user they need to be logged in to do that
        return HttpResponseRedirect(
            '/accounts/login/')  #redirect to login page
    else:
        currentUser = request.user
        userProfile = profileUtil.getProfileFromUser(currentUser)
        print(userProfile.personalShed)
        reputation = profileUtil.getReputation(userProfile)
        timeCreated = userProfile.timeCreated
        streetAddress = profileUtil.getAddress(userProfile)
        city = profileUtil.getCity(userProfile)
        state = profileUtil.getStateName(userProfile)
        shareZone = profileUtil.getSharezone(userProfile)
        context = {}
        context.update(csrf(request))
        context['userProfile'] = userProfile
        context['timeStamp'] = timeCreated
        context['streetAddress'] = streetAddress
        context['reputation'] = reputation
        context['city'] = city
        context['state'] = state
        context['sharezone'] = shareZone
        context.update(content.genBaseLoggedIn(request))
        if contextArg:
            context.update(contextArg)
        return render_to_response('my_account.html', context)
 def test_GetAddress(self):
     """
     """
     self.assertEqual (profUtils.getAddress(self.getProfile), "Room 42, Jedi Temple Master's Quarters")
 def test_UpdateAddress(self):
     """
     """
     profUtils.updateAddress (self.getProfile, "Hut, Dune Sea", "Mos Eisley", "Tatooine", "Sandpeople")
     self.assertEqual (profUtils.getAddress (self.getProfile), "Hut, Dune Sea")
Example #7
0
 def test_GetAddress(self):
     """
     """
     self.assertEqual(profUtils.getAddress(self.getProfile),
                      "Room 42, Jedi Temple Master's Quarters")
Example #8
0
 def test_UpdateAddress(self):
     """
     """
     profUtils.updateAddress (self.getProfile, "Hut, Dune Sea, near Mos Eisley, Tatooine")
     self.assertEqual (profUtils.getAddress (self.getProfile), "Hut, Dune Sea, near Mos Eisley, Tatooine")