def test_get_profile_data_unauthenticated(self):
     request = self.factory.get("/")
     request.user = AnonymousUser()
     context = get_profile_data(request)
     self.assertEqual(context["username"], "")
     self.assertEqual(context["date_of_birth"], "")
     self.assertEqual(context["alias"], "")
 def test_get_profile_data_unauthenticated(self):
     request = self.factory.get('/')
     request.user = AnonymousUser()
     context = get_profile_data(request)
     self.assertEqual(context['username'], '')
     self.assertEqual(context['date_of_birth'], '')
     self.assertEqual(context['alias'], '')
Ejemplo n.º 3
0
 def test_get_profile_data_unauthenticated(self):
     request = self.factory.get('/')
     request.user = AnonymousUser()
     context = get_profile_data(request)
     self.assertEqual(context['username'], '')
     self.assertEqual(context['date_of_birth'], '')
     self.assertEqual(context['alias'], '')
 def test_get_profile_data_authenticated_dob(self):
     profile = self.user.profile
     profile.date_of_birth = date(1980, 1, 1)
     profile.save()
     request = self.factory.get('/')
     request.user = self.user
     context = get_profile_data(request)
     self.assertEqual(context['date_of_birth'], date(1980, 1, 1))
 def test_get_profile_data_authenticated_alias(self):
     profile = self.user.profile
     profile.alias = 'The Alias'
     profile.save()
     request = self.factory.get('/')
     request.user = self.user
     context = get_profile_data(request)
     self.assertEqual(context['alias'], 'The Alias')
Ejemplo n.º 6
0
 def test_get_profile_data_authenticated_dob(self):
     profile = self.user.profile
     profile.date_of_birth = date(1980, 1, 1)
     profile.save()
     request = self.factory.get('/')
     request.user = self.user
     context = get_profile_data(request)
     self.assertEqual(context['date_of_birth'], date(1980, 1, 1))
Ejemplo n.º 7
0
 def test_get_profile_data_authenticated_alias(self):
     profile = self.user.profile
     profile.alias = 'The Alias'
     profile.save()
     request = self.factory.get('/')
     request.user = self.user
     context = get_profile_data(request)
     self.assertEqual(context['alias'], 'The Alias')
 def test_get_profile_data_authenticated_alias(self):
     profile = self.user.profile
     profile.alias = "The Alias"
     profile.save()
     request = self.factory.get("/")
     request.user = self.user
     context = get_profile_data(request)
     self.assertEqual(context["alias"], "The Alias")
 def test_get_profile_data_authenticated_anonymous(self):
     request = self.factory.get('/')
     request.user = self.user
     context = get_profile_data(request)
     self.assertEqual(context['username'], 'tester')
     self.assertEqual(context['alias'], 'Anonymous')
Ejemplo n.º 10
0
 def test_get_profile_data_authenticated_anonymous(self):
     request = self.factory.get('/')
     request.user = self.user
     context = get_profile_data(request)
     self.assertEqual(context['username'], 'tester')
     self.assertEqual(context['alias'], 'Anonymous')
 def test_get_profile_data_authenticated_anonymous(self):
     request = self.factory.get("/")
     request.user = self.user
     context = get_profile_data(request)
     self.assertEqual(context["username"], "tester")
     self.assertEqual(context["alias"], "Anonymous")