docstr: Method：
  1. create a collection with max partitions
  2. insert, build, load and search
  3. drop collection
  4. create a collection with max partitions + 1
  5. verify the error raised
docstr_tok: ["Method\uff1a","1.","create","a","collection","with","max","partitions","2.","insert",",","build",",","load","and","search","3.","drop","collection","4.","create","a","collection","with","max","partitions","+","1","5.","verify","the","error","raised"]
code: def test_max_partitions(self):
      """
      Method：
      1. create a collection with max partitions
      2. insert, build, load and search
      3. drop collection
      4. create a collection with max partitions + 1
      5. verify the error raised
      """
      max_partition = 4096
      self._connect()
      pk_field = cf.gen_int64_field(name="pk", is_primary=True)
      int64_field = cf.gen_int64_field()
      string_field = cf.gen_string_field(is_partition_key=True)
      vector_field = cf.gen_float_vec_field()
      schema = cf.gen_collection_schema(
          fields=[pk_field, int64_field, string_field, vector_field],
          auto_id=True,
      )
      c_name = cf.gen_unique_str("par_key")
      collection_w, _ = self.collection_wrap.init_collection(
          name=c_name, schema=schema, num_partitions=max_partition
      )
      assert len(collection_w.partitions) == max_partition
  
      # insert
      nb = 100
      string_prefix = cf.gen_str_by_length(length=6)
      for _ in range(5):
          int64_values = [i for i in range(0, nb)]
          string_values = [string_prefix + str(i) for i in range(0, nb)]
          float_vec_values = gen_vectors(nb, ct.default_dim)
          data = [int64_values, string_values, float_vec_values]
          collection_w.insert(data)
  
      # drop collection
      collection_w.drop()
  
      # create a collection with min partitions - 1
      num_partitions = max_partition + 1
      err_msg = f"partition number ({num_partitions}) exceeds max configuration ({max_partition})"
      c_name = cf.gen_unique_str("par_key")
      collection_w, _ = self.collection_wrap.init_collection(
          name=c_name,
          schema=schema,
          num_partitions=num_partitions,
          check_task=CheckTasks.err_res,
          check_items={"err_code": 2, "err_msg": err_msg},
      )
  
imports: import pytest
  from base.client_base import TestcaseBase
  from common import common_func
  from common import common_type
  from common.common_type import CaseLabel, CheckTasks
  from utils.util_pymilvus import *
label_desc: Use image node_id 1 for calling the TestPartitionKeyInvalidParams obj's underlying member method code with example usage: obj.test_max_partitions() without return types