def test_should_import_devoce_data(self, api_client): # Given : Sample Data expected_device_count = 5 # When : 해당 데이터를 database에 넣는 코드 실행 Device.load_initial_data() # Then : 총 5개의 데이터가 들어가야함 devices = Device.objects.all() assert expected_device_count == len(devices)
def handle(self, *args, **options): Stat.load_initial_data() Device.load_initial_data() self.stdout.write( self.style.SUCCESS('Successfully created basic data'))