def setUp(self):
self.username = self.VALID_USERNAME<EOL>self.password = self.VALID_PASSWORD<EOL>self.email = self.VALID_EMAIL<EOL>self.ip_address = self.VALID_IP_ADDRESS<EOL>self.user_agent = self.VALID_USER_AGENT<EOL>self.path_info = reverse('<STR_LIT>')<EOL>self.user = get_user_model().objects.create_superuser(<EOL>username=self.username,<EOL>password=self.password,<EOL>email=self.email,<EOL>)<EOL>self.request = HttpRequest()<EOL>self.request.method = '<STR_LIT:POST>'<EOL>self.request.META['<STR_LIT>'] = self.ip_address<EOL>self.request.META['<STR_LIT>'] = self.user_agent<EOL>self.request.META['<STR_LIT>'] = self.path_info<EOL>self.request.axes_attempt_time = now()<EOL>self.request.axes_ip_address = get_client_ip_address(self.request)<EOL>self.request.axes_user_agent = get_client_user_agent(self.request)<EOL>self.request.axes_path_info = get_client_path_info(self.request)<EOL>self.request.axes_http_accept = get_client_http_accept(self.request)<EOL>self.credentials = get_credentials(self.username)<EOL>
Create a valid user for login.