from django.core.management import call_command
from django.test import TestCase


class ServerTest(TestCase):
    def test_update_game_info(self):
        call_command('update_game_info')

from django.core.management import call_command
from django.test import TestCase
from game_info.models import Server


class ServerTest(TestCase):
    def create_server(self, title="Test Server", host="example.org", port=27015):
        return Server.objects.create(title=title, host=host, port=port)

    def test_update_game_info(self):
        self.create_server().save()
        call_command('update_game_info')

Fix testing on update_game_info management command
Fix testing on update_game_info management command

  from django.core.management import call_command
  from django.test import TestCase
+ from game_info.models import Server
  
  
  class ServerTest(TestCase):
+     def create_server(self, title="Test Server", host="example.org", port=27015):
+         return Server.objects.create(title=title, host=host, port=port)
+ 
      def test_update_game_info(self):
+         self.create_server().save()
          call_command('update_game_info')
  
Fix testing on update_game_info management command
## Code Before:
from django.core.management import call_command
from django.test import TestCase


class ServerTest(TestCase):
    def test_update_game_info(self):
        call_command('update_game_info')

## Instruction:
Fix testing on update_game_info management command
## Code After:
from django.core.management import call_command
from django.test import TestCase
from game_info.models import Server


class ServerTest(TestCase):
    def create_server(self, title="Test Server", host="example.org", port=27015):
        return Server.objects.create(title=title, host=host, port=port)

    def test_update_game_info(self):
        self.create_server().save()
        call_command('update_game_info')
