@@ -0,0 +1,2276 @@
+from users.views import ListAllView, home%0Afrom django.test import TestCase%0Afrom django.test.client import RequestFactory%0Afrom django.test import Client%0Afrom users.models import User,UserManager%0A%0Aclass ListAllViewTest(TestCase):%0A    def setUp(self):%0A        self.client = Client()%0A        self.first_user = User()%0A        self.first_user.email = %22first@example.com%22%0A        self.first_user.password='12345678'%0A        self.first_user.phonenumber='01011111111'%0A        self.first_user.name='first'%0A        self.second_user = User()%0A        self.second_user.email = %22second@example.com%22%0A        self.second_user.password='12345678'%0A        self.second_user.phonenumber='01022222222'%0A        self.second_user.name='second'%0A        self.listAll_url = '/users/list/'%0A%0A    def test_list_all_should_be_loaded_with_proper_url_with_user(self):%0A        self.first_user.save(using = User.objects._db)%0A        response = self.client.get(self.listAll_url)%0A        self.assertEqual(response.status_code, 200,%0A                         %22Response Code should be 200(OK)%22)%0A%0A    def test_list_all_should_raise_404_with_no_users(self):%0A        response = self.client.get(self.listAll_url)%0A        self.assertEqual(response.status_code, 404,%0A                         %22Response Code should be 404(NOT FOUND) with no users in DB%22)%0A%0A    def test_list_all_should_contain_user_with_saved_one_user(self):%0A        self.first_user.save(using = User.objects._db)%0A        response = self.client.get(self.listAll_url)%0A        self.assertContains(response,self.first_user.email)%0A        self.assertContains(response,self.first_user.name)%0A        self.assertContains(response,self.first_user.phonenumber)%0A%0A    def test_list_all_should_contain_user_with_saved_two_user(self):%0A        self.first_user.save(using = User.objects._db)%0A        self.second_user.save(using = User.objects._db)%0A        response = self.client.get(self.listAll_url)%0A        self.assertContains(response,self.first_user.email)%0A        self.assertContains(response,self.first_user.name)%0A        self.assertContains(response,self.first_user.phonenumber)%0A        self.assertContains(response,self.second_user.email)%0A        self.assertContains(response,self.second_user.name)%0A        self.assertContains(response,self.second_user.phonenumber)

add test code for listAll view