import unittest
import django.test
from django.core.exceptions import ValidationError

from core.tests.setups import RobrechtSocialUserFactory
from ..validators import RepoExistanceValidator


###############################################################################
#                                    Forms                                    #
###############################################################################

'''
from ..forms import InvestmentModelForm

class InvestmentModelFormTestCase(TestCase):
    """
    Tests for InvestmentModelForm
    """
    def test_initial_value_of_investor_type(self):
        """
        Verify initial value of investor_type field of InvestmentModelForm.
        """
        investor_type_initial = InvestmentModelForm().fields["investor_type"].initial
        self.assertEqual(investor_type_initial, "PERSON")
'''


###############################################################################
#                                 Validators                                  #
###############################################################################

# Test takes longer than average test because of requests call
#@unittest.skip("")
class RepoExistanceValidatorTestCase(django.test.TestCase):
    def test_repo_existance_validator(self):
        user_rob = RobrechtSocialUserFactory()
        self.assertRaises(ValidationError, RepoExistanceValidator(user_rob), "asiakas/non_existing_branch")

import unittest
import django.test
from django.core.exceptions import ValidationError

from core.tests.setups import RobrechtSocialUserFactory
from ..validators import RepoExistanceValidator


###############################################################################
#                                    Forms                                    #
###############################################################################

'''
from ..forms import InvestmentModelForm

class InvestmentModelFormTestCase(TestCase):
    """
    Tests for InvestmentModelForm
    """
    def test_initial_value_of_investor_type(self):
        """
        Verify initial value of investor_type field of InvestmentModelForm.
        """
        investor_type_initial = InvestmentModelForm().fields["investor_type"].initial
        self.assertEqual(investor_type_initial, "PERSON")
'''


###############################################################################
#                                 Validators                                  #
###############################################################################

# Test takes about ~0.7 secs because of requests call
@unittest.skip("")
class RepoExistanceValidatorTestCase(django.test.TestCase):
    def test_repo_existance_validator(self):
        user_rob = RobrechtSocialUserFactory()
        self.assertRaises(ValidationError, RepoExistanceValidator(user_rob), "asiakas/non_existing_branch")

Write note for test that triggers get request
Write note for test that triggers get request

  import unittest
  import django.test
  from django.core.exceptions import ValidationError
  
  from core.tests.setups import RobrechtSocialUserFactory
  from ..validators import RepoExistanceValidator
  
  
  ###############################################################################
  #                                    Forms                                    #
  ###############################################################################
  
  '''
  from ..forms import InvestmentModelForm
  
  class InvestmentModelFormTestCase(TestCase):
      """
      Tests for InvestmentModelForm
      """
      def test_initial_value_of_investor_type(self):
          """
          Verify initial value of investor_type field of InvestmentModelForm.
          """
          investor_type_initial = InvestmentModelForm().fields["investor_type"].initial
          self.assertEqual(investor_type_initial, "PERSON")
  '''
  
  
  ###############################################################################
  #                                 Validators                                  #
  ###############################################################################
  
- # Test takes longer than average test because of requests call
+ # Test takes about ~0.7 secs because of requests call
- #@unittest.skip("")
+ @unittest.skip("")
  class RepoExistanceValidatorTestCase(django.test.TestCase):
      def test_repo_existance_validator(self):
          user_rob = RobrechtSocialUserFactory()
          self.assertRaises(ValidationError, RepoExistanceValidator(user_rob), "asiakas/non_existing_branch")
  
Write note for test that triggers get request
## Code Before:
import unittest
import django.test
from django.core.exceptions import ValidationError

from core.tests.setups import RobrechtSocialUserFactory
from ..validators import RepoExistanceValidator


###############################################################################
#                                    Forms                                    #
###############################################################################

'''
from ..forms import InvestmentModelForm

class InvestmentModelFormTestCase(TestCase):
    """
    Tests for InvestmentModelForm
    """
    def test_initial_value_of_investor_type(self):
        """
        Verify initial value of investor_type field of InvestmentModelForm.
        """
        investor_type_initial = InvestmentModelForm().fields["investor_type"].initial
        self.assertEqual(investor_type_initial, "PERSON")
'''


###############################################################################
#                                 Validators                                  #
###############################################################################

# Test takes longer than average test because of requests call
#@unittest.skip("")
class RepoExistanceValidatorTestCase(django.test.TestCase):
    def test_repo_existance_validator(self):
        user_rob = RobrechtSocialUserFactory()
        self.assertRaises(ValidationError, RepoExistanceValidator(user_rob), "asiakas/non_existing_branch")

## Instruction:
Write note for test that triggers get request
## Code After:
import unittest
import django.test
from django.core.exceptions import ValidationError

from core.tests.setups import RobrechtSocialUserFactory
from ..validators import RepoExistanceValidator


###############################################################################
#                                    Forms                                    #
###############################################################################

'''
from ..forms import InvestmentModelForm

class InvestmentModelFormTestCase(TestCase):
    """
    Tests for InvestmentModelForm
    """
    def test_initial_value_of_investor_type(self):
        """
        Verify initial value of investor_type field of InvestmentModelForm.
        """
        investor_type_initial = InvestmentModelForm().fields["investor_type"].initial
        self.assertEqual(investor_type_initial, "PERSON")
'''


###############################################################################
#                                 Validators                                  #
###############################################################################

# Test takes about ~0.7 secs because of requests call
@unittest.skip("")
class RepoExistanceValidatorTestCase(django.test.TestCase):
    def test_repo_existance_validator(self):
        user_rob = RobrechtSocialUserFactory()
        self.assertRaises(ValidationError, RepoExistanceValidator(user_rob), "asiakas/non_existing_branch")
