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'], '')
Exemplo 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')
Exemplo 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))
Exemplo 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')
Exemplo 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")